Permalink
Browse files

Prevent array_merge running on a non-existent array

  • Loading branch information...
1 parent b36f2a3 commit 96af999fbf3882e7b1e8591729dbce95144ceacb @kolber committed Mar 19, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 app/asset-types/asset-factory.inc.php
View
5 app/asset-types/asset-factory.inc.php
@@ -13,7 +13,7 @@ static function extract_page_data($asset_path) {
# return any page data scoped against the asset filename
$page_data = self::$store[$page_path];
- return isset($page_data[$file_name]) ? $page_data[$file_name] : array();
+ return $page_data[$file_name];
}
static function &create($file_path) {
@@ -40,10 +40,9 @@ static function &create($file_path) {
# extract any page data scoped against the asset filename
$page_data = self::extract_page_data($file_path);
-
# create a new asset and return its data
$asset = new $asset($file_path);
- return array_merge($asset->data, $page_data);
+ return array_merge($asset->data, is_array($page_data) ? $page_data : array());
} else {
# new page

0 comments on commit 96af999

Please sign in to comment.