#27190 [Opn->Bgs]: bug in stripslashes function with \0
| From: | derick@php.net | Date: | Mon, 09 Feb 2004 16:38:43 +0000 |
| Subject: | #27190 [Opn->Bgs]: bug in stripslashes function with \0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-54618@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: Open
+Status: Bogus
Bug Type: Strings related
Operating System: all
PHP Version: 4.3.4
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
See also docs foor addslashes and stripslashes.
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