Hi,

denis could you try this patch proposed here : http://www.glpi-project.org/forum/viewtopic.php?id=22834
which is based on yours.

Regards

Julien


|--- inc/notificationtemplate.class.php.orig     2011-01-24 01:52:54.000000000 
+0100
+++ inc/notificationtemplate.class.php  2011-02-04 10:02:13.000000000 +0100
@@ -208,7 +208,7 @@
             Plugin::loadLang(strtolower($plug['plugin']));
          }

-         if ($template_datas = $this->getByLanguage($language)) {
+        if ($template_datas = 
html_entity_decode_deep($this->getByLanguage($language))) {
             //Template processing
             // Decode html chars to have clean text
             $data = html_entity_decode_deep($data);
@@ -323,14 +323,13 @@


    static function processIf($string, $data) {
-
-      if (preg_match_all("/##IF([a-z\.]*)[=]?([\w ]*)##/i",$string,$out)) {
+      if (preg_match_all("/##IF([a-z\.]*)[=]?(.*?)##/i",$string,$out)) {
          foreach ($out[1] as $key =>  $tag_infos) {
             $if_field = $tag_infos;
             //Get the field tag value (if one)
-            $regex_if = "/##IF".$if_field."[=]?[\w 
]*##(.*)##ENDIF".$if_field."##/Uis";
+            $regex_if = 
"/##IF".$if_field."[=]?.*##(.*)##ENDIF".$if_field."##/Uis";
             //Get the else tag value (if one)
-            $regex_else = "/##ELSE".$if_field."[=]?[\w 
]*##(.*)##ENDELSE".$if_field."##/Uis";
+            $regex_else = 
"/##ELSE".$if_field."[=]?.*##(.*)##ENDELSE".$if_field."##/Uis";
             if (empty($out[2][$key])){ // No = : check if ot empty or not null
                if (isset($data['##'.$if_field.'##'])
                   &&  $data['##'.$if_field.'##'] != ''
@@ -342,7 +341,7 @@
                }
             } else { // check exact match
                if (isset($data['##'.$if_field.'##'])
-&&  $data['##'.$if_field.'##'] == $out[2][$key]) {
+&&  html_entity_decode_deep($data['##'.$if_field.'##']) == $out[2][$key]) {
                   $condition_ok=true;
                } else {
                   $condition_ok=false;|



_______________________________________________
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev

Reply via email to