Re: Smarty with PHP 4.01pl2
| From: | Hojtsy Gabor | Date: | Sat, 17 Feb 2001 15:53:44 +0000 |
| Subject: | Re: Smarty with PHP 4.01pl2 | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-131@lists.php.net to get a copy of this message | ||
> call_user_func_array
>
> Added the call_user_func_array() function which gives you the ability
> to call a user function by passing an array of parameters as the
> second argument. (Sterling)
Well, I am working on this now. This is used in Smarty.addons.php
starting on line 40 (with 1.2.1). The best I have made:
I inserted there my new wa function:
function _smary_slash_workaround (&$value, $key) {
$value = str_replace("'", "\\'", $value);
}
And instead of
$var[$key] = call_user_func_array($func_name, $args);
I write:
array_walk($args, "_smary_slash_workaround");
eval("\$wa_result = $func_name('" . join("',", $args) .
"');");
$var[$key] = $wa_result;
Not too fast, but works well with the demo template, and PHP 403pl1...
The same code needs to be added to the else statement...
Is there any cases this code will fail to do what it needs to
(if there is anybody working on this issue)?
Now going onto get_defined_vars(). It would be worse I think...
Goba
__________________________________________________________________
Hungarian PHP Manual :: Hungarian PHP Mirror :: http://hu.php.net/
The starintg-point for Hungarian webmasters :: http://weblabor.hu/