• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-plugins: Commit

Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの


Commit MetaInfo

Revisione9beaeaa3b0e79d7f678a9543c83c7e749636b7c (tree)
Time2009-03-20 08:25:34
Authorkmorimatsu <kmorimatsu@1ca2...>
Commiterkmorimatsu

Log Message

sqlite: debug, MySQL-specific comment, '-- '.

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@989 1ca29b6e-896d-4ea0-84a5-967f57386b96

Change Summary

Incremental Difference

--- a/sqlite/trunk/nucleus/sqlite/sqlite.php
+++ b/sqlite/trunk/nucleus/sqlite/sqlite.php
@@ -111,9 +111,6 @@ function nucleus_mysql_query($p1,$p2=null,$unbuffered=false){//echo htmlspecialc
111111 if (strpos($query,"\xEF\xBB\xBF")===0) $query=substr($query,3);// UTF-8 stuff
112112 if (substr($query,-1)==';') $query=substr($query,0,strlen($query)-1);
113113
114- // Remove MySQL specific comment, '-- '.
115- $query=preg_replace('/($|[\r\n])\-\-[\s^\r\n]([^\r\n]*)/','',$query);
116-
117114 // Escape style is changed from MySQL type to SQLite type here.
118115 // This is important to avoid possible SQL-injection.
119116 $strpositions=array();// contains the data show where the strings are (startposition => endposition)
@@ -287,6 +284,8 @@ function sqlite_changeQuote(&$query){
287284 if ($i2<($j=$i1)) $j=$i2;
288285 if ($i3<$j) $j=$i3;
289286 $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);
290289 $ret.=($temp);
291290 $c=$query[($i=$j)]; // $c keeps the type of quote.
292291 if (strstr($temp,';')) exit('Warning: try to use more than two queries?');
Show on old repository browser