if (strpos($query,"\xEF\xBB\xBF")===0) $query=substr($query,3);// UTF-8 stuff\r
if (substr($query,-1)==';') $query=substr($query,0,strlen($query)-1);\r
\r
- // Remove MySQL specific comment, '-- '.\r
- $query=preg_replace('/($|[\r\n])\-\-[\s^\r\n]([^\r\n]*)/','',$query);\r
- \r
// Escape style is changed from MySQL type to SQLite type here.\r
// This is important to avoid possible SQL-injection.\r
$strpositions=array();// contains the data show where the strings are (startposition => endposition)\r
if ($i2<($j=$i1)) $j=$i2;\r
if ($i3<$j) $j=$i3;\r
$temp=preg_replace('/[\s]+/',' ',substr($query,$i,$j-$i)); // Change all spacying to ' '.\r
+ // Remove MySQL specific comment, '-- '.\r
+ $temp=preg_replace('/($|[\r\n])\-\-[\s^\r\n]([^\r\n]*)/',' ',$temp);\r
$ret.=($temp);\r
$c=$query[($i=$j)]; // $c keeps the type of quote.\r
if (strstr($temp,';')) exit('Warning: try to use more than two queries?');\r