ID: 11236
Updated by: andrei
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: PCRE related
Operating System: Linux
PHP Version: 4.0.5
New Comment:

This works in latest CVS - try upgrading to 4.0.6 or later.

Previous Comments:
------------------------------------------------------------------------

[2001-06-11 10:04:46] [EMAIL PROTECTED]

Just an update -- this issue seems to be to do with having lots of single quotes (') 
in the string. It has also been an issue in strings other than the one shown in my 
first post.

6 quotes seems to be the limit of what it can handle.

John

------------------------------------------------------------------------

[2001-06-01 07:11:28] [EMAIL PROTECTED]

This issue seems to only affect PHP 4.0.5, not earlier versions, as far as I can tell.

The following code gives an error:

<?

$string="

[code]

EXEC sp_addlinkedserver 'TillDB', 'Access 2000', 'Microsoft.Jet.OLEDB.4.0', 
'\\till01\C\endx\data\ct.mdb'
EXEC sp_addlinkedsrvlogin 'TillDB', false, NULL, 'Admin', NULL
EXEC sp_dropserver 'TIllDB', 'droplogins'

[/code]

";

function stripbrsfromcode($str) {
  return ($str);
}

//$string=str_replace("'","\'",$string);
$string=addslashes($string);

echo $string;


$string=preg_replace("/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/esiU","stripbrsfromcode('\\5')",$string);


echo $string;
?>

The error is as follows:
[code] EXEC sp_addlinkedserver \'TillDB\', \'Access 2000\', 
\'Microsoft.Jet.OLEDB.4.0\', \'\till01\C\endx\data\ct.mdb\' EXEC sp_addlinkedsrvlogin 
\'TillDB\', false, NULL, \'Admin\', NULL EXEC sp_dropserver \'TIllDB\', \'droplogins\' 
[/code] 
Parse error: parse error in /usr/local/apache/htdocs/test.php(24) : regexp code on 
line 5

Fatal error: Failed evaluating code: stripbrsfromcode(' EXEC sp_addlinkedserver 
\\\'TillDB\\\', \\\'Access 2000\\\', \\\'Microsoft.Jet.OLEDB.4.0\\\', 
\\\'\\till01\\C\\endx\\data\\ct.mdb\\\' EXEC sp_addlinkedsrvlogin \\\'TillDB\\\', 
false, NULL, \\\'Admin\\\', NULL EXEC sp_dropserver \\'TIllDB\\', \\'droplogins\\' ') 
in /usr/local/apache/htdocs/test.php on line 24


Let me know if you need other info. I have seen this problem on two independant 
configurations, so I am fairly sure it is not the server.

phpinfo here:
http://161.58.186.97/phpinfo.php

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=11236&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to