]> git.mxchange.org Git - mailer.git/blobdiff - inc/filters.php
Better this way...
[mailer.git] / inc / filters.php
index fa28dba40068e882bdf918aab32727d3806a4327..6b33ba7f8a117af4cc7d0815ccb818c4f1e3d7d7 100644 (file)
@@ -459,15 +459,29 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) {
                // Replace all matches
                foreach ($matches[2] as $key => $cmd) {
                        // Init replacer/call-back variable
-                       $replacer = '';
-                       $callback = '';
+                       $replacer      = '';
+                       $callback      = '';
                        $extraFunction = '';
+                       $value         = '';
 
                        // Extract command and call-back
                        $cmdArray = explode(',', $cmd);
                        $cmd = $cmdArray[0];
-                       if (isset($cmdArray[1])) $callback      = $cmdArray[1];
-                       if (isset($cmdArray[2])) $extraFunction = $cmdArray[2];
+
+                       // Detect call-back function
+                       if (isset($cmdArray[1])) {
+                               // Call-back function detected
+                               $callback = $cmdArray[1];
+                       } // END - if
+
+                       // Detect extra function
+                       if (isset($cmdArray[2])) {
+                               // Also detected
+                               $extraFunction = $cmdArray[2];
+                       } elseif (isset($matches[4][$key])) {
+                               // Use this as value
+                               $value = $matches[4][$key];
+                       }
 
                        // Construct call-back function name for the command
                        $commandFunction = 'doExpression' . ucfirst(strtolower($cmd));
@@ -481,7 +495,8 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) {
                                        'mode'       => $outputMode,
                                        'code'       => $code,
                                        'callback'   => $callback,
-                                       'extra_func' => $extraFunction
+                                       'extra_func' => $extraFunction,
+                                       'value'      => $value
                                );
 
                                // Call it