Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの
Revision | e9beaeaa3b0e79d7f678a9543c83c7e749636b7c (tree) |
---|---|
Time | 2009-03-20 08:25:34 |
Author | kmorimatsu <kmorimatsu@1ca2...> |
Commiter | kmorimatsu |
sqlite: debug, MySQL-specific comment, '-- '.
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@989 1ca29b6e-896d-4ea0-84a5-967f57386b96
@@ -111,9 +111,6 @@ function nucleus_mysql_query($p1,$p2=null,$unbuffered=false){//echo htmlspecialc | ||
111 | 111 | if (strpos($query,"\xEF\xBB\xBF")===0) $query=substr($query,3);// UTF-8 stuff |
112 | 112 | if (substr($query,-1)==';') $query=substr($query,0,strlen($query)-1); |
113 | 113 | |
114 | - // Remove MySQL specific comment, '-- '. | |
115 | - $query=preg_replace('/($|[\r\n])\-\-[\s^\r\n]([^\r\n]*)/','',$query); | |
116 | - | |
117 | 114 | // Escape style is changed from MySQL type to SQLite type here. |
118 | 115 | // This is important to avoid possible SQL-injection. |
119 | 116 | $strpositions=array();// contains the data show where the strings are (startposition => endposition) |
@@ -287,6 +284,8 @@ function sqlite_changeQuote(&$query){ | ||
287 | 284 | if ($i2<($j=$i1)) $j=$i2; |
288 | 285 | if ($i3<$j) $j=$i3; |
289 | 286 | $temp=preg_replace('/[\s]+/',' ',substr($query,$i,$j-$i)); // Change all spacying to ' '. |
287 | + // Remove MySQL specific comment, '-- '. | |
288 | + $temp=preg_replace('/($|[\r\n])\-\-[\s^\r\n]([^\r\n]*)/',' ',$temp); | |
290 | 289 | $ret.=($temp); |
291 | 290 | $c=$query[($i=$j)]; // $c keeps the type of quote. |
292 | 291 | if (strstr($temp,';')) exit('Warning: try to use more than two queries?'); |