New extension added, ext-uberwach rewritten (unfinished), some fixes
[mailer.git] / inc / filters.php
index 5cda96ebf2c825db507989015475aecf07c9bdd0..d1a66567e57ec8d67f81ed989bf92da20ec85b19 100644 (file)
@@ -456,11 +456,17 @@ function FILTER_COMPILE_EXTENSION ($code) {
        if ((count($matches) > 0) && (count($matches[3]) > 0)) {
                // Replace all matches
                foreach ($matches[3] as $key => $cmd) {
-                       // Construct call-back function name
-                       $functionName = 'getExtension' . ucfirst(strtolower($cmd));
+                       // By default we have no extension installed, so 'false' is assumed
+                       $replacer = 'false';
 
-                       // Call the function
-                       $replacer = call_user_func_array($functionName, $matches[4][$key]);
+                       // Is the extension installed?
+                       if (isExtensionActive($matches[4][$key])) {
+                               // Construct call-back function name
+                               $functionName = 'getExtension' . ucfirst(strtolower($cmd));
+
+                               // Call the function
+                               $replacer = call_user_func_array($functionName, $matches[4][$key]);
+                       } // END - if
 
                        // Replace it and insert parameter for GET request
                        $code = str_replace($matches[0][$key], sprintf("&%s=%s&rev=%s", $cmd, $replacer, getConfig('CURR_SVN_REVISION')), $code);