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
-
Fabrice Luraine October 17th, 2009 @ 06:41 PM
- State changed from new to resolved
(from [d3ad1f3481867cc2ea5ea3b28ea3c4c94b8db1ae]) Fix notice that can occurs in render() when a % isn't necessarily a placeholder % caracter. [#32 state:resolved] http://github.com/sofadesign/limonade/commit/d3ad1f3481867cc2ea5ea3...
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.
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
- 32 vsprintf notice if a route function doesn't exists (from [d3ad1f3481867cc2ea5ea3b28ea3c4c94b8db1ae]) Fix not...