Minahito
minah****@users*****
2005年 12月 27日 (火) 14:28:38 JST
Index: xoops2jp/html/class/database/sqlutility.php diff -u xoops2jp/html/class/database/sqlutility.php:1.2.8.1 xoops2jp/html/class/database/sqlutility.php:1.2.8.2 --- xoops2jp/html/class/database/sqlutility.php:1.2.8.1 Tue Dec 27 00:45:45 2005 +++ xoops2jp/html/class/database/sqlutility.php Tue Dec 27 14:28:38 2005 @@ -28,14 +28,20 @@ { $this->dirname = $dirname; $i = 0; - $sql_query = file(ORETEKI_ROOT_PATH.'/modules/'.$dirname.'/'.$file); + $sql_query = file(XOOPS_MODULE_PATH.'/'.$dirname.'/'.$file); $pattern = "/^(INSERT INTO|CREATE TABLE|UPDATE)/siU"; foreach ( $sql_query as $fline ) { + $fline=trim($fline); if ( preg_match($pattern,$fline) ) { $i++; $this->sql[$i] = trim($fline)."\n"; - } else { - $this->sql[$i].= trim($fline)."\n"; + } elseif (strlen($fline)>0 && strpos($fline,"#")===false) { + if(isset($this->sql[$i])) { + $this->sql[$i] .= trim($fline)."\n"; + } + else { + $this->sql[$i] = trim($fline)."\n"; + } } } @@ -51,7 +57,7 @@ if ( preg_match($pattern, $sql, $matches) ) { $replace = "\\1 ".XOOPS_DB_PREFIX."_\\4\\5"; $sql = preg_replace($pattern, $replace, $sql); - if ( preg_match("/^CREATE TABLE/siU", $sql) && !in_array($matches[4],$safetables) ) { + if ( preg_match("/^CREATE TABLE/siU", $sql) && !in_array($matches[4],$this->safetables) ) { $this->create[] = $matches[4]; } }