Re: [SMARTY-DEV] mixing of asign() and assign_by_ref() overwrites external vars
| From: | Sebastian Mendel | Date: | Tue, 08 Jun 2004 06:57:53 +0000 |
| Subject: | Re: [SMARTY-DEV] mixing of asign() and assign_by_ref() overwrites external vars | ||
| References: | 1 2 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2415@lists.php.net to get a copy of this message | ||
Boots schrieb:
--- Sebastian Mendel <lists@sebastianmendel.de> wrote:i forgot: also i think it makes no sense to use smarty manipulating vars in this way, i think it should be a one-way extern -> smarty and not extern <-> smarty ! i think no one will ever use smarty to change a value of a external var by doing an assign() ! it also leads to a possible security-leak, so template designer can change vars outside of the template! (also in accident!) - yes, i know, this is very abstract. i think the main advantage (and the only thing wanted/used for?) of assign_by_ref is that it not need to be copied in to the smarty-object. -- Sebastian Mendel www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com www.sf.net/projects/phpdatetime www.sf.net/projects/phptimesheetBoots schrieb:[..snip..][...] It doesn't solve the problem: the original poster was mis-using the feature.:-( i dont think so!$myvar = true; var_dump($myvar); echo '<br />';$test = new Smarty; $test->assign_by_ref('myvar', $myvar); $test_2 = $test; $test_2->assign('myvar', false); var_dump($myvar); echo '<br />';I'm suggesting that you don't really want to use assign_by_ref.