diff --git a/admin-dev/tabs/AdminInformation.php b/admin-dev/tabs/AdminInformation.php index ca54d1f19..6763d541b 100644 --- a/admin-dev/tabs/AdminInformation.php +++ b/admin-dev/tabs/AdminInformation.php @@ -160,7 +160,7 @@ class AdminInformation extends AdminTab
'.$this->l('MySQL Version').': - '.mysql_get_server_info().' + '.Db::getInstance()->getVersion().'
'; if (function_exists('apache_get_modules') AND in_array('mod_instaweb', apache_get_modules())) echo ''.$this->l('PageSpeed module for Apache installed (mod_instaweb)').'
'; diff --git a/classes/Backup.php b/classes/Backup.php index 2eeacc685..f2e07d24a 100644 --- a/classes/Backup.php +++ b/classes/Backup.php @@ -205,7 +205,7 @@ class BackupCore foreach ($row AS $field => $value) { - $tmp = "'" . mysql_real_escape_string($value) . "',"; + $tmp = "'" . pSQL($value) . "',"; if($tmp != "'',") $s .= $tmp; else diff --git a/classes/Db.php b/classes/Db.php index 048379dde..6b3681adc 100644 --- a/classes/Db.php +++ b/classes/Db.php @@ -243,6 +243,13 @@ abstract class DbCore */ abstract public function nextRow($result = false); + /** + * Get database version + * + * @return string + */ + abstract public function getVersion(); + /** * Alias of Db::getInstance()->ExecuteS * diff --git a/classes/MySQL.php b/classes/MySQL.php index 894c5081c..a1608d2c3 100644 --- a/classes/MySQL.php +++ b/classes/MySQL.php @@ -260,6 +260,14 @@ class MySQLCore extends Db die(Tools::displayError((mysql_error()))); } } + + /** + * @see DbCore::getVersion() + */ + public function getVersion() + { + return mysql_get_server_info(); + } static public function tryToConnect($server, $user, $pwd, $db) { diff --git a/modules/mondialrelay/mondialrelay.php b/modules/mondialrelay/mondialrelay.php index 665347e80..31f63d30b 100755 --- a/modules/mondialrelay/mondialrelay.php +++ b/modules/mondialrelay/mondialrelay.php @@ -732,7 +732,7 @@ class MondialRelay extends Module Db::getInstance()->Execute($query); - $mainInsert = mysql_insert_id(); + $mainInsert = Db::getInstance()->Insert_ID(); $default = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "configuration WHERE name = 'PS_CARRIER_DEFAULT'"); $check = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "carrier"); $checkD = array(); @@ -756,7 +756,7 @@ class MondialRelay extends Module (`url`, `name`, `active`, `is_module`, `range_behavior`) VALUES(NULL, "'.pSQL('mondialrelay').'", "1", "1", "1")'); - $get = Db::getInstance()->getRow('SELECT * FROM `' . _DB_PREFIX_ . 'carrier` WHERE `id_carrier` = "' . mysql_insert_id() . '"'); + $get = Db::getInstance()->getRow('SELECT * FROM `' . _DB_PREFIX_ . 'carrier` WHERE `id_carrier` = "' . Db::getInstance()->Insert_ID() . '"'); Db::getInstance()->Execute('UPDATE `' . _DB_PREFIX_ . 'mr_method` SET `id_carrier` = "' . (int)($get['id_carrier']) . '" WHERE `id_mr_method` = "' . pSQL($mainInsert) . '"'); $weight_coef = Configuration::get('MR_WEIGHT_COEF'); $range_weight = array('24R' => array(0, 20000 / $weight_coef), 'DRI' => array(20000 / $weight_coef, 130000 / $weight_coef), 'LD1' => array(0, 60000 / $weight_coef), 'LDS' => array(30000 / $weight_coef, 130000 / $weight_coef));