From a96ab9a5871e0e27b3c8ad1fad5c810a53a54cbb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 29 Jun 2012 10:07:11 +0200 Subject: [PATCH] Fix: missing parameters ! --- htdocs/install/lib/repair.lib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/install/lib/repair.lib.php b/htdocs/install/lib/repair.lib.php index d71dd5d7380..c51cf7ec281 100644 --- a/htdocs/install/lib/repair.lib.php +++ b/htdocs/install/lib/repair.lib.php @@ -39,7 +39,8 @@ function checkElementExist($id, $table) $num = $db->num_rows($resql); if ($num > 0) return true; else return false; - } + } + else return true; // for security } /** @@ -56,6 +57,9 @@ function checkLinkedElements($sourcetype, $targettype) $elements=array(); $deleted=0; + $sourcetable=$sourcetype; + $targettable=$targettype; + if ($sourcetype == 'shipping') $sourcetable = 'expedition'; else if ($targettype == 'shipping') $targettable = 'expedition'; if ($sourcetype == 'delivery') $sourcetable = 'livraison'; @@ -88,7 +92,7 @@ function checkLinkedElements($sourcetype, $targettype) if (! empty($elements)) { foreach($elements as $key => $element) - { + { if (! checkElementExist($element[$sourcetype], $sourcetable) || ! checkElementExist($element[$targettype], $targettable)) { $sql = 'DELETE FROM '.MAIN_DB_PREFIX .'element_element';