From 8547cdb2c4d1a4f5e80243c93a4e02d6d72a2b65 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 19 Nov 2012 03:35:34 +0100 Subject: [PATCH] Templates are now compiled using PACKAGE_ID Previously compiled templates were stored with their origin's package id, which prevents duplicates among shared templates. This is dangerous when using template listeners, as they may be included in a different environment, but cause errors in other environments. Fixes #911 --- .../files/lib/system/template/TemplateEngine.class.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php b/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php index b880045418..42e3236531 100755 --- a/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php +++ b/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php @@ -409,20 +409,18 @@ class TemplateEngine extends SingletonFactory { * Returns the absolute filename of a compiled template. * * @param string $templateName - * @param integer $packageID */ - public function getCompiledFilename($templateName, $packageID) { - return $this->compileDir.$packageID.'_'.$this->templateGroupID.'_'.$this->languageID.'_'.$templateName.'.php'; + public function getCompiledFilename($templateName) { + return $this->compileDir.PACKAGE_ID.'_'.$this->templateGroupID.'_'.$this->languageID.'_'.$templateName.'.php'; } /** * Returns the absolute filename for template's meta data. * * @param string $templateName - * @param integer $packageID */ - public function getMetaDataFilename($templateName, $packageID) { - return $this->compileDir.$packageID.'_'.$this->templateGroupID.'_'.$templateName.'.meta.php'; + public function getMetaDataFilename($templateName) { + return $this->compileDir.PACKAGE_ID.'_'.$this->templateGroupID.'_'.$templateName.'.meta.php'; } /** -- 2.20.1