Bug #16070: Set any variable after error occur..
| From: | rusek at ccs dot cz | Date: | Thu, 14 Mar 2002 15:01:14 +0000 |
| Subject: | Bug #16070: Set any variable after error occur.. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-2492@lists.php.net to get a copy of this message | ||
From: rusek@ccs.cz
Operating system: Windows, Unix BSD, Linux RedHat
PHP version: 4.1.2
PHP Bug Type: Variables related
Bug description: Set any variable after error occur..
<?PHP
/* reported by Milan Rusek, rusek@ccs.cz
*/
echo 'Before: '.(isset($retval)?'set':'not set');
echo "\n";
$retval = @unserialize('blablabla'); // FAIL !!!!
// variable $retval it should not be set!!
echo 'After : '.(isset($retval)?'set':'not set');
echo "\n";
echo "It must be same results!\n";
/* ----------------------------------------------
* I have found only one solution, but I mean
* that it is very small powerful:
$retval = @unserialize('blablabla');
if (serialize($retval) == 'blablabla')
{
// is ok.
}
else
{
// is failed.
}
* Do you have some better solution?
*/
?>
--
Edit bug report at http://bugs.php.net/?id=16070&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16070&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16070&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16070&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16070&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16070&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16070&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16070&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16070&r=submittedtwice