[-] BO : #PSCFV-3222 - Fix array unique strange working

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16439 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-07-16 13:44:38 +00:00
parent ff27b55c3a
commit 367496bfe8
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -2178,6 +2178,19 @@ FileETag INode MTime Size
return false;
}
/**
* Reproduce array_unique working before php version 5.2.9
* @param array $array
* @return array
*/
public static function arrayUnique($array)
{
if (version_compare(phpversion(), '5.2.9', '<'))
return array_unique($array);
else
return array_unique($array, SORT_REGULAR);
}
}
/**
@@ -3567,7 +3567,7 @@ class AdminProductsControllerCore extends AdminController
if ($ws)
$warehouses[] = $ws;
}
$warehouses = array_unique($warehouses);
$warehouses = Tools::arrayUnique($warehouses);
if (empty($warehouses))
$advanced_stock_management_warning = true;