From: Tim Düsterhus Date: Tue, 10 Jun 2014 15:37:07 +0000 (+0200) Subject: Fix constructor of Template.class.php X-Git-Tag: 2.1.0_Alpha_1~732^2~2^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=89df46fe56d5bbc30da95f160acdf12c19734075;p=GitHub%2FWoltLab%2FWCF.git Fix constructor of Template.class.php --- diff --git a/wcfsetup/install/files/lib/data/template/Template.class.php b/wcfsetup/install/files/lib/data/template/Template.class.php index e3bdbcc61a..604b802ae6 100644 --- a/wcfsetup/install/files/lib/data/template/Template.class.php +++ b/wcfsetup/install/files/lib/data/template/Template.class.php @@ -46,18 +46,20 @@ class Template extends DatabaseObject { $statement->execute(array($id)); $row = $statement->fetchArray(); - // get relative directory of the template the application - // belongs to - if ($row['application'] != 'wcf') { - $application = ApplicationHandler::getInstance()->getApplication($row['application']); + if ($row !== false) { + // get relative directory of the template the application + // belongs to + if ($row['application'] != 'wcf') { + $application = ApplicationHandler::getInstance()->getApplication($row['application']); + } + else { + $application = ApplicationHandler::getInstance()->getWCF(); + } + $row['packageDir'] = PackageCache::getInstance()->getPackage($application->packageID)->packageDir; } else { - $application = ApplicationHandler::getInstance()->getWCF(); + $row = array(); } - $row['packageDir'] = PackageCache::getInstance()->getPackage($application->packageID)->packageDir; - - // enforce data type 'array' - if ($row === false) $row = array(); } else if ($object !== null) { $row = $object->data;