]> git.mxchange.org Git - core.git/commitdiff
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 6b8145f46c629e939e4f9956b9ffa08d0e5998cf..e7592c008d7b2631f988a7cc12763a7db1189273 100644 (file)
@@ -106,6 +106,11 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private $regExpCodeTags = '/\{\?([a-z_]+)(:("[^"]+"|[^?}]+)+)?\?\}/';
 
         */
        private $regExpCodeTags = '/\{\?([a-z_]+)(:("[^"]+"|[^?}]+)+)?\?\}/';
 
+       /**
+        * A regular expression to find template comments like <!-- Comment here //-->
+        */
+       private $regExpComments = '/<!--[\w\W]*?(\/\/){0,1}-->/';
+
        /**
         * Loaded helpers
         */
        /**
         * Loaded helpers
         */
@@ -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
                $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])) {
 
                // Do we have entries?
                if (isset($matches[0][0])) {