Code

Updated Placeholder handling, fixed problems with UPPER/lowercase handling
[gosa.git] / gosa-core / include / functions.inc
index fde2df70e0fb1343eade77fd7793ef86b8647b42..22670325a322509c57f3c9a8fed9e99d8d96f171 100644 (file)
@@ -3717,11 +3717,14 @@ function fillReplacements($str, $attrs, $shellArg = FALSE, $default = "")
     }
     krsort($hits);
 
+    // Add lower case placeholders to avoid errors
+    foreach($attrs as $key => $attr) $attrs[strtolower($key)] = $attr;
+
     // Replace the placeholder in the given string now.
     foreach($hits as $match){
 
         // Avoid errors about undefined index.
-        $name = $match[2];
+        $name = strtolower($match[2]);
         if(!isset($attrs[$name])) $attrs[$name] = $default;
 
         // Calculate the replacement