More relaxed check (only first X characters)
[core.git] / inc / classes / main / template / class_BaseTemplateEngine.php
index c1aa4f8fc22f1be5be4675005f75ea9c5b1e617b..e719ebb7a1a1f63f932f74d34e4cb29e5f273179 100644 (file)
@@ -1245,8 +1245,11 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         *                                                                                      count has been found
         */
        public function compileTemplate () {
         *                                                                                      count has been found
         */
        public function compileTemplate () {
+               // Get code type to make things shorter
+               $codeType = $this->getConfigInstance()->getConfigEntry('code_template_type');
+
                // We will only work with template type "code" from configuration
                // We will only work with template type "code" from configuration
-               if ($this->getTemplateType() != $this->getConfigInstance()->getConfigEntry('code_template_type')) {
+               if (substr($this->getTemplateType(), 0, strlen($codeType)) != $codeType) {
                        // Abort here
                        throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->getConfigEntry('code_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
                } // END - if
                        // Abort here
                        throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->getConfigEntry('code_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
                } // END - if