Skip to content
Permalink
Browse files

[integration:xoops] correction for MySQLi Connection (mysqli API)

  • Loading branch information
nao-pon committed Sep 7, 2013
1 parent bc5a453 commit b1d95133af55f1f65e2d8d157856a17c325ba61c
@@ -62,7 +62,7 @@
}

for ($i = 1 ; $i <= $count ; $i++) {
$sql = "SELECT name,options FROM ".$db->prefix('newblocks')." WHERE mid=".$mid." AND func_num=".$i." AND show_func='".mysql_real_escape_string($modversion['blocks'][$i]['show_func'])."' AND func_file='".mysql_real_escape_string($modversion['blocks'][$i]['file'])."'";
$sql = "SELECT name,options FROM ".$db->prefix('newblocks')." WHERE mid=".$mid." AND func_num=".$i." AND show_func=".$db->quoteString($modversion['blocks'][$i]['show_func'])." AND func_file='".mysql_real_escape_string($modversion['blocks'][$i]['file'])."'";
$fresult = $db->query($sql);
$fblock = $db->fetchArray($fresult);
if ( isset( $fblock['options'] ) ) {
@@ -41,7 +41,11 @@ function xpwiki_oninstall_base( $module , $mydirname )
$sql_query = trim( file_get_contents( $sql_file_path ) ) ;

// [ MySQL Version >= 5 ] BLOB and TEXT columns cannot be assigned a default value.
$mysql_ver = mysql_get_server_info();
if (is_object($db->conn) && get_class($db->conn) === 'mysqli') {
$mysql_ver = mysqli_get_server_info($db->conn);
} else {
$mysql_ver = mysql_get_server_info();
}
if (@ $mysql_ver{0} >= 5) {
$sql_query = str_replace(' default \'\'', '', $sql_query);
}

0 comments on commit b1d9513

Please sign in to comment.
You can’t perform that action at this time.