Date: 06/26/98
- Next message: philip <email protected>: "[PHP-DEV] Bug #486: ODBC odbc_result_into & CURSOR_DYNAMIC"
- Previous message: shane: "[PHP-DEV] CVS update: php31/sapi"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: philip <email protected>
Operating system: Linux Elf-i586
PHP version: 3.0 Final Release
PHP Bug Type: Misbehaving function
Bug description:
The ereg_replace command does not correctly substitute
backslash escaped strings correctly.
In the following example:
$s1="One\nTwo\n\nEnd\nWhere have the nnns gone";
$s2 = ereg_replace("\n","\\n",$s1);
$s3 = ereg_replace("\\n","\n",$s2);
Produces for $s2
"One\nTwo\n\nEnd\nWhere have the nnns gone"
But Produces for $s3:
"O
e\
Two\
\
E
d\
Where have the
s go
e
"
The command appears to be replacing the \\ with \\ and the n with linefeed
Looking at the lengths of the strings string s3 is the same length as string s2.
This behaviour is not affected by the setting of magic_quotes_runtime.
The behaviour is the same for both inbuilt or system regex library.
The DOS version 3.0b6 also has this behaviour.
The workaround is to use stripslashes for unix. Stripslashes does not
work as expected under the DOS version (3.0b6).
Background:
There is a problem with the mysql odbc driver under linux which
replaces all linefeeds in text fields with spaces. To avoid this it
is necessary to escape all line feeds before inserting into the
tables.
- Next message: philip <email protected>: "[PHP-DEV] Bug #486: ODBC odbc_result_into & CURSOR_DYNAMIC"
- Previous message: shane: "[PHP-DEV] CVS update: php31/sapi"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

