#27190 [Bgs->Opn]: bug in stripslashes function with \0

From: Date: Mon, 09 Feb 2004 12:14:55 +0000
Subject: #27190 [Bgs->Opn]: bug in stripslashes function with \0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-54609@lists.php.net to get a copy of this message
ID: 27190 Updated by: derick@php.net Reported By: tohar at sphera dot com -Status: Bogus +Status: Open Bug Type: Unknown/Other Function Operating System: all PHP Version: 4.3.4 New Comment: Inside '' it shouldn't be a NULL byte... Previous Comments: ------------------------------------------------------------------------ [2004-02-09 05:37:30] sniper@php.net And that's what it is..no bug here. ------------------------------------------------------------------------ [2004-02-09 05:28:13] andrey@php.net Next time use var_dump() which is better. Looks like \0 is intepreted as NULL byte. <?php $x1 = 'a\b\c\22\0||TYPE'; $x2 = 'a\b\c\22\13||TYPE'; var_dump(stripslashes($x1)); echo "\n"; var_dump(stripslashes($x2)); echo "\n"; ?> Output : string(12) "abc22||TYPE" string(13) "abc2213||TYPE" ------------------------------------------------------------------------ [2004-02-09 04:42:47] tohar at sphera dot com Description: ------------ When using stripslashes function on a string with \0, the 0 character which should have returned, doesnt returned!!! Reproduce code: --------------- <? $x1 = 'a\b\c\22\0||TYPE'; $x2 = 'a\b\c\22\13||TYPE'; echo stripslashes($x1); echo "<BR>"; echo stripslashes($x2); ?> Expected result: ---------------- abc220||TYPE abc2213||TYPE Actual result: -------------- abc22||TYPE abc2213||TYPE ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27190&edit=1

« previous php.bugs (#54609) next »