[-] 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:
@@ -2178,6 +2178,19 @@ FileETag INode MTime Size
|
|||||||
|
|
||||||
return false;
|
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)
|
if ($ws)
|
||||||
$warehouses[] = $ws;
|
$warehouses[] = $ws;
|
||||||
}
|
}
|
||||||
$warehouses = array_unique($warehouses);
|
$warehouses = Tools::arrayUnique($warehouses);
|
||||||
|
|
||||||
if (empty($warehouses))
|
if (empty($warehouses))
|
||||||
$advanced_stock_management_warning = true;
|
$advanced_stock_management_warning = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user