#32 ✓resolved
Fabrice Luraine

vsprintf notice if a route function doesn't exists

Reported by Fabrice Luraine | September 22nd, 2009 @ 08:24 AM | in Release 0.4 - Fresh Mint And Ginger

vsprintf notice if a route function doesn't exists

When a routing error occurs because the target function doesn't exists, it returns a vsprintf() PHP notice instead of a routing error (Routing error: undefined function 'xxxxx').

Because the % can occurs in the error string, and isn't necessarily a placeholder % caracter, we should'nt use vsprintf() function in render()

This can be solved in render() function by replacing

else
{
   $content = vsprintf($content_or_func, $vars);
}

by:

else
{
    if(substr_count($text, '%') !== count($vars)) $content = $content_or_func;
    else $content = vsprintf($content_or_func, $vars);
}

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Limonade is a PHP micro-framework.

People watching this ticket

Referenced by

Pages