Moved regex to variable.
authorRoland Haeder <roland@mxchange.org>
Sun, 9 Feb 2014 00:34:48 +0000 (01:34 +0100)
committerRoland Haeder <roland@mxchange.org>
Sun, 9 Feb 2014 00:34:48 +0000 (01:34 +0100)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/classes/main/template/class_BaseTemplateEngine.php

index 6b8145f..e7592c0 100644 (file)
@@ -107,6 +107,11 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
        private $regExpCodeTags = '/\{\?([a-z_]+)(:("[^"]+"|[^?}]+)+)?\?\}/';
 
        /**
+        * A regular expression to find template comments like <!-- Comment here //-->
+        */
+       private $regExpComments = '/<!--[\w\W]*?(\/\/){0,1}-->/';
+
+       /**
         * Loaded helpers
         */
        private $helpers = array();
@@ -1592,7 +1597,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $compactedContent = str_replace(chr(9), '', str_replace(chr(10), '', str_replace(chr(13), '', $uncompactedContent)));
 
                // Then regex all comments like <!-- //--> away
-               preg_match_all('/<!--[\w\W]*?(\/\/){0,1}-->/', $compactedContent, $matches);
+               preg_match_all($this->regExpComments, $compactedContent, $matches);
 
                // Do we have entries?
                if (isset($matches[0][0])) {