Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの
Revision | 28db45305f4cb96ed1afa18b9d63630a159fe87d (tree) |
---|---|
Time | 2009-03-18 04:57:55 |
Author | kmorimatsu <kmorimatsu@1ca2...> |
Commiter | kmorimatsu |
SQLite: support using '-- ' as comment.
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@986 1ca29b6e-896d-4ea0-84a5-967f57386b96
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | /**************************************** |
3 | 3 | * SQLite-MySQL wrapper for Nucleus * |
4 | - * ver 0.9.0.4 * | |
4 | + * ver 0.9.0.5 * | |
5 | 5 | * Written by Katsumi * |
6 | 6 | ****************************************/ |
7 | 7 |
@@ -13,7 +13,7 @@ if (!function_exists('sqlite_open')) exit('Sorry, SQLite is not available from P | ||
13 | 13 | require_once dirname(__FILE__) . '/sqliteconfig.php'; |
14 | 14 | $SQLITE_DBHANDLE=sqlite_open($SQLITECONF['DBFILENAME']); |
15 | 15 | require_once dirname(__FILE__) . '/sqlitequeryfunctions.php'; |
16 | -$SQLITECONF['VERSION']='0.9.0.4'; | |
16 | +$SQLITECONF['VERSION']='0.9.0.5'; | |
17 | 17 | |
18 | 18 | //Following thing may work if MySQL is NOT installed in server. |
19 | 19 | if (!function_exists('mysql_query')) { |
@@ -111,6 +111,9 @@ 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 | + | |
114 | 117 | // Escape style is changed from MySQL type to SQLite type here. |
115 | 118 | // This is important to avoid possible SQL-injection. |
116 | 119 | $strpositions=array();// contains the data show where the strings are (startposition => endposition) |