Minahito
minah****@users*****
2006年 8月 29日 (火) 19:16:36 JST
Index: xoops2jp/html/modules/base/admin/class/EasyLex_SQLScanner.class.php diff -u xoops2jp/html/modules/base/admin/class/EasyLex_SQLScanner.class.php:1.1.2.3 xoops2jp/html/modules/base/admin/class/EasyLex_SQLScanner.class.php:1.1.2.4 --- xoops2jp/html/modules/base/admin/class/EasyLex_SQLScanner.class.php:1.1.2.3 Thu Aug 24 15:55:38 2006 +++ xoops2jp/html/modules/base/admin/class/EasyLex_SQLScanner.class.php Tue Aug 29 19:16:36 2006 @@ -1,7 +1,7 @@ <?php /** * @package EasyLexSQL - * @varsion $Id: EasyLex_SQLScanner.class.php,v 1.1.2.3 2006/08/24 06:55:38 minahito Exp $ + * @varsion $Id: EasyLex_SQLScanner.class.php,v 1.1.2.4 2006/08/29 10:16:36 minahito Exp $ * * In the original BSD license, both occurrences of the phrase "COPYRIGHT * HOLDERS AND CONTRIBUTORS" in the disclaimer read "REGENTS AND CONTRIBUTORS". @@ -38,6 +38,7 @@ define('EASYLEX_SQL_DIGIT', 1); define('EASYLEX_SQL_LETTER', 2); define('EASYLEX_SQL_STRING_LITERAL', 3); +define('EASYLEX_SQL_STRING_LITERAL_ESCAPE', 10); define('EASYLEX_SQL_OPEN_PARENTHESIS', 4); define('EASYLEX_SQL_CLOSE_PARENTHESIS', 5); define('EASYLEX_SQL_SEPARATER', 6); @@ -102,6 +103,7 @@ break; case EASYLEX_SQL_STRING_LITERAL: + case EASYLEX_SQL_STRING_LITERAL_ESCAPE: $this->_parseStringLiteral($ch, $type); break; @@ -242,7 +244,14 @@ { $this->mActiveToken .= $ch; $this->mIndex++; - if ($ch == $this->mActiveQuoteMark && substr($this->mActiveToken, -2, 1) != "\\" && substr($this->mActiveToken, -3, 1) != "\\") { + + if ($ch == "\\" && $this->mStatus == EASYLEX_SQL_STRING_LITERAL) { + $this->mStatus = EASYLEX_SQL_STRING_LITERAL_ESCAPE; + } + elseif ($this->mStatus == EASYLEX_SQL_STRING_LITERAL_ESCAPE) { + $this->mStatus = EASYLEX_SQL_STRING_LITERAL; + } + elseif ($ch == $this->mActiveQuoteMark) { $this->_createToken(); } }