2011/2/3 MoYo <m...@indepnet.net>

>  Hi,
>
> thanks for your interest in GLPI.
> A similar bug report could be found here :
> http://www.glpi-project.org/forum/viewtopic.php?id=22834
>
>
> The proposed solution : replace \w by \p{L}
> Could you test it and validate the proposed solution ?
>

No, without changes this patch don't work for me,

I get
[03-02-2011 13:36]  Новый ответ по заявке Автор Денис
##IFfollowup.isprivate=Да## Личный ##ENDIFfollowup.isprivate## :
фывфыв

Others IF conditions works fine.

But in my version template also decoded
@@ -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);

but even with that, patch from forum don't work for Russian letters in
template.
But this one (remove Ui from regexp)

      if (preg_match_all("/##IF([a-z\.]*)[=]?([\p{L}\w
]*)##/",$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."[=]?[\p{L}\w
]*##(.*)##ENDIF".$if_field."##/s";
            //Get the else tag value (if one)
            $regex_else = "/##ELSE".$if_field."[=]?[\p{L}\w
]*##(.*)##ENDELSE".$if_field."##/s";

with
-         if ($template_datas = $this->getByLanguage($language)) {
+         if ($template_datas =
html_entity_decode_deep($this->getByLanguage($language))) {

also works, as my.
I don't understand for what this change,

-                  && $data['##'.$if_field.'##'] == $out[2][$key]) {
+                  && $data['##'.$if_field.'##'] ==
htmlentities(utf8_decode($out[2][$key]))) {

without it my template works fine.



> For the second problem, you are right about addslashes.
>
> Thanks for all.
>

No problem!



> Regards
>
>
>
>
> Le 02/02/2011 16:08, Denis Linvinus a écrit :
>
> Hi GLPI team!
> i'm migrating from 0.72.2 to 0.78.2, because almost all my patches was
> included in this release,
> but again utf8 problems :)
>
> There is my favorite template, it indicate that followup is private only if
> that is true
>
> ##FOREACHfollowups##
> [##followup.date##]  Новый ответ по заявке ##lang.followup.author##
> ##followup.author##  ##IFfollowup.isprivate=Да## ##lang.followup.isprivate##
> ##ENDIFfollowup.isprivate## :
> ##followup.description##
> ##ENDFOREACHfollowups##
>
> But it will not works because \w in regexp support only latin symbols. This
> bug can be easily resolved if use .*?
>
> notificationtemplate.class.php_utf8.patch
>
>
>
> Second problem with mailgate and ticket,
> when creating new ticket from email, with empty email subject,
> ticket subject creating from mail body with limiting to 70 utf8 chars,
> but! if at place 69-71 was \\n then ticket subject will contain incorret
> text which will cause error in mysql
>
> Error posted there http://pastebin.com/DqTFCX8u
>
> Look at \\n *\\\*',\'yyyyyyyy...@xxxx.ru
>
> Possible solution, but i'm not sure at 100%
> ticket.class.php_slashes_problem.patch
>
>
>
>
>
>
> _______________________________________________
> Glpi-dev mailing listGlpi-dev@gna.orghttps://mail.gna.org/listinfo/glpi-dev
>
>
>
> _______________________________________________
> Glpi-dev mailing list
> Glpi-dev@gna.org
> https://mail.gna.org/listinfo/glpi-dev
>
>
_______________________________________________
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev

Reply via email to