today's offers - xanax use in pregnancy xanax xr be abused soma internet pharmacies fedex soma without priscription fed ex phentermine parkinson drugs phentermine baclofen tramadol together ordering tramadol cod viagra find search 76k cialis pages cialis buy on line viagra for sale without a prescription buy onlinecom phentermine viagra ambien and klonopin drug interaction buy ambien overnight cheap online pharmacies valium saturday delivery valium online with no prescription or membership fioricet overnight no rx cheap fioricet without a prescription order meridia cod fedex meridia cheap fed ex delivery xanax bradycardia what does xanax look like american soma how to buy soma online without prescriptin phentermine overnight echeck c o d 375 mg phentermine rss feed cheap no prescription tramadol stop the tramadol generic prices online cialis generic cialis fedex chinese herbal viagra taking partial pill of viagra ambien and pregnancy smoking ambien cod online valium buy cheap valium without prescription no prescription fioricet with fedex fioricet without prescription in Brasilia order meridia meridia information

php preg_replace bug ??


這個問題在在Zend Framework 中
Zend/Db/Statement.php
裡面
[cc lang="php" tab_size="2" lines="40"]
protected function _stripQuoted($sql)
{
// get the character for delimited id quotes,
// this is usually ” but in MySQL is `
$d = $this->_adapter->quoteIdentifier(‘a’);
$d = $d[0];

// get the value used as an escaped delimited id quote,
// e.g. \” or “” or \`
$de = $this->_adapter->quoteIdentifier($d);
$de = substr($de, 1, 2);
$de = str_replace(‘\\’, ‘\\\\’, $de);

// get the character for value quoting
// this should be ‘
$q = $this->_adapter->quote(‘a’);
$q = $q[0];

// get the value used as an escaped quote,
// e.g. \’ or ”
$qe = $this->_adapter->quote($q);
$qe = substr($qe, 1, 2);
$qe = str_replace(‘\\’, ‘\\\\’, $qe);

// get a version of the SQL statement with all quoted
// values and delimited identifiers stripped out
// remove “foo\”bar”
$sql = preg_replace(“/$q($qe|\\\\{2}|[^$q])*$q/”, ”, $sql);
// remove ‘foo\’bar’
if (!empty($q)) {
$sql = preg_replace(“/$q($qe|[^$q])*$q/”, ”, $sql);
}

return $sql;
}

[/cc]
發現的
我是要執行一段db->query($sql)
sql 是 insert into xxx
有把sql 單純的print 出來到mysql 中執行是可以成功執行的
trace 到最後發現會卡在preg_replace這邊
而看httpd error , access log 都沒有訊息
看message log 就會出現
Nov 12 13:22:33 mail kernel: pid 50728 (httpd), uid 80: exited on signal 4
所以判斷應該是
php 的bug

我的解法是不用preg_replace 換成
ereg_replace, mb_ereg_replace
都可以.

  1. No comments yet.
(will not be published)

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word