Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

vsprintf notice if a route function doesn't exists

#32

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);
}

Reported by Fabrice Luraine · September 22nd, 2009 @ 08:24 AM

State: resolved
Assigned to: Fabrice Luraine Fabrice Luraine

Activity

  1. Fabrice Luraine
    Fabrice Luraine
    • State changed from new to resolved

    (from [d3ad1f3481867cc2ea5ea3b28ea3c4c94b8db1ae]) Fix notice that can occurs in render() when a % isn't necessarily a placeholder % caracter. [#32 vsprintf notice if a route function doesn't exists state:resolved] http://github.com/sofadesign/limonade/commit/d3ad1f3481867cc2ea5ea3...

    October 17th, 2009 @ 06:41 PM

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.