mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Check for an empty list of keys before attempting to create an array with them (from r96997)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102416 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
474a6a9931
commit
04857b811f
10
main.php
10
main.php
@ -69,9 +69,13 @@ if (function_exists('mb_http_output')) {
|
||||
* This is for versions of PHP prior to version 5.2
|
||||
*/
|
||||
if (!function_exists('array_fill_keys')) {
|
||||
function array_fill_keys($keys,$value) {
|
||||
return array_combine($keys,array_fill(0,count($keys),$value));
|
||||
}
|
||||
function array_fill_keys($keys,$value) {
|
||||
//Sometimes we get passed an empty array, and if that's the case, you'll get an error message
|
||||
if(sizeof($keys)==0)
|
||||
return Array();
|
||||
else
|
||||
return array_combine($keys,array_fill(0,count($keys),$value));
|
||||
}
|
||||
}
|
||||
|
||||
Session::start();
|
||||
|
Loading…
Reference in New Issue
Block a user