BUGFIX: test that the class exists before running subclass tests (from r101631)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112012 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-13 00:55:31 +00:00
parent 1e860727db
commit f073c9b60c

View File

@ -1399,9 +1399,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
foreach($allFields as $field => $fieldSpec) { foreach($allFields as $field => $fieldSpec) {
if(preg_match('/([^(]+)/', $fieldSpec, $matches)) { if(preg_match('/([^(]+)/', $fieldSpec, $matches)) {
$class = $matches[0]; $class = $matches[0];
if(class_exists($class)){
if($class == 'HTMLText' || is_subclass_of($class, 'HTMLText')) $htmlFields[] = $field; if($class == 'HTMLText' || is_subclass_of($class, 'HTMLText')) $htmlFields[] = $field;
} }
} }
}
$linkedPages = array(); $linkedPages = array();
$linkedFiles = array(); $linkedFiles = array();