Skip to content

Commit b1d9513

Browse files
committed
[integration:xoops] correction for MySQLi Connection (mysqli API)
1 parent bc5a453 commit b1d9513

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

xoops_trust_path/modules/xpwiki/include/x20_keepblockoptions.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
}
6363

6464
for ($i = 1 ; $i <= $count ; $i++) {
65-
$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'])."'";
65+
$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'])."'";
6666
$fresult = $db->query($sql);
6767
$fblock = $db->fetchArray($fresult);
6868
if ( isset( $fblock['options'] ) ) {

xoops_trust_path/modules/xpwiki/oninstall.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ function xpwiki_oninstall_base( $module , $mydirname )
4141
$sql_query = trim( file_get_contents( $sql_file_path ) ) ;
4242

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

0 commit comments

Comments
 (0)