From 27a5961cbaedfbc492371e43c4aa3a000722ed7a Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 3 Aug 2009 01:46:46 +0000 Subject: [PATCH] BUGFIX: Reverted broken optimisation in r83439 git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@83477 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Object.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/core/Object.php b/core/Object.php index 51fe23c83..00d828ac2 100755 --- a/core/Object.php +++ b/core/Object.php @@ -261,21 +261,20 @@ abstract class Object { * @return mixed */ public static function uninherited_static($class, $name) { - if(isset(self::$cache_is_inherited[$class][$name])) { - return self::$cache_is_inherited[$class][$name] ? null : self::get_static($class, $name); + $inherited = self::get_static($class, $name); + $parent = null; - } else { - $inherited = self::get_static($class, $name); - $parent = null; - if($parentClass = get_parent_class($class)) { - $parent = self::get_static($parentClass, $name); - } + if($parentClass = get_parent_class($class)) { + $parent = self::get_static($parentClass, $name); + } - self::$cache_is_inherited[$class][$name] = ($inherited == $parent); - return ($inherited == $parent) ? null : $inherited; - } + if(is_array($inherited) && is_array($parent)) { + return array_diff_assoc($inherited, $parent); + } + + return ($inherited != $parent) ? $inherited : null; } - + /** * Cache the results of whether or not a given var is inherited. */