note 32380 deleted from function.str-rot13 by vrana

From: Date: Tue, 20 Jan 2004 15:14:30 +0000
Subject: note 32380 deleted from function.str-rot13 by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-63883@lists.php.net to get a copy of this message
Note Submitter: elfan@ungu.net ---- There's a simple way to trick the bug of str_rot13(). As reported in http://bugs.php.net/bug.php?id=20261 , there's a bug with str_rot13(). str_rot13() changes the value of other variables that "linked" to the parameter of str_rot13(). So, if you're using PHP version 4.2.0 until 4.2.3 here's the trick : <? $aaa = "foo"; $bbb = $aaa; $ccc = $bbb; $ddd = str_rot13($ccc.""); //pass a string rather than a variable echo "aaa=$aaa \n"; echo "bbb=$bbb \n"; echo "ccc=$ccc \n"; echo "ddd=$ddd \n"; ?> This way, the result will only stored on variable $ddd, leaving $aaa, $bbb, and $ccc unchanged. If you also want $ccc to be changed (but not $aaa and $bbb), you can do this : <? $ddd = str_rot13(&$ccc); //use the "&" ?>

« previous php.notes (#63883) next »