[-] MO: fix blocktopmenu install
This commit is contained in:
+2
-2
@@ -156,7 +156,7 @@ abstract class ModuleCore
|
||||
SELECT `id_module`
|
||||
FROM `'._DB_PREFIX_.'module`
|
||||
WHERE `name` = \''.pSQL($this->name).'\'');
|
||||
if ($result)
|
||||
if (0&&$result)
|
||||
return false;
|
||||
|
||||
$result = Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table, array('name' => $this->name, 'active' => 1), 'INSERT');
|
||||
@@ -658,7 +658,7 @@ abstract class ModuleCore
|
||||
else
|
||||
$errors[] = sprintf(Tools::displayError('%1$s (parse error in %2$s)'), $module, substr($filepath, strlen(_PS_ROOT_DIR_)));
|
||||
}
|
||||
|
||||
|
||||
if (class_exists($module,false))
|
||||
{
|
||||
$moduleList[$moduleListCursor++] = new $module;
|
||||
|
||||
+6
-1
@@ -180,7 +180,7 @@ abstract class DbCore
|
||||
public static function getClass()
|
||||
{
|
||||
$class = 'MySQL';
|
||||
if (class_exists('mysqli', false))
|
||||
if (0&&class_exists('mysqli', false))
|
||||
$class = 'DbMySQLi';
|
||||
return $class;
|
||||
}
|
||||
@@ -361,6 +361,11 @@ abstract class DbCore
|
||||
public function executeS($sql, $array = true, $use_cache = 1)
|
||||
{
|
||||
$sql = (string)$sql;
|
||||
|
||||
// This methode must be used only with queries which display results
|
||||
if (!preg_match('#^\s*(select|show|explain)\s#i', $sql))
|
||||
throw new PrestashopDatabaseException('Db->executeS() must be used only with select, show or explain queries');
|
||||
|
||||
$this->result = false;
|
||||
$this->last_query = $sql;
|
||||
if ($use_cache && _PS_CACHE_ENABLED_ && $array && ($result = Cache::getInstance()->get(md5($sql))))
|
||||
|
||||
Reference in New Issue
Block a user