PHP <5.3.4 compat (is_a() usage)

Our build infrastructure still runs an ancient 5.3.3,
and given this is the only blocker for it, worth
complicating the code a bit to retain this compatibility.
This commit is contained in:
Ingo Schommer 2013-10-21 10:19:41 +02:00
parent 4f3c258bf4
commit 576e462823

View File

@ -134,7 +134,7 @@ class BlogHolder extends BlogTree implements PermissionProvider {
// Add default widgets to first found WidgetArea relationship
if(class_exists('WidgetArea')) {
foreach($this->has_one() as $name => $class) {
if(is_a($class, 'WidgetArea', true)) {
if($class == 'WidgetArea' || is_subclass_of($class, 'WidgetArea')) {
$relationName = "{$name}ID";
$widgetarea = new WidgetArea();
$widgetarea->write();