On Friday 08 February 2011 11:11:52 Denis wrote:
> Hello!
Hello Denis,

I'm the guy who wrote on the forum about the same problem as you.

> Theris my template before html_entity_decode_deep
> 
> #IFfollowup.isprivate=Да## ##lang.followup.isprivate##
> ##ENDIFfollowup.isprivate## : ##followup.description##
> ##ENDFOREACHfollowups##

OK, I'm now sure your template is HTML encoded in your database (as 
mine).
 
> there is after
> 
> ##IFfollowup.isprivate=Да## ##lang.followup.isprivate##
> ##ENDIFfollowup.isprivate## : ##followup.description##
> ##ENDFOREACHfollowups##
Ok, same as mine.

> My problem is that condition "=Да" present in database as
> "=Да" so without decode my condition will not work!
In last patch I posted (based on yours), I included your line : 
 +        if ($template_datas = html_entity_decode_deep($this-
>getByLanguage($language))) { 
This decodes HTML template in UTF-8.

> This one patch work for me.
> 
> note 1  $data already decoded on:
>             //Template processing
>             // Decode html chars to have clean text
>             $data = "">
$data is only decoded in text mode I think. For HTML, you have this line 
which rencodes everything in HTML : 
               $data_html = htmlentities_deep($data);

> so decode other side $data['##'.$if_field.'##'] ==
> html_entity_decode_deep($out[2][$key]) )
Either you decode this here or in $template_datas like you did before.

> note 2 , regexp ".*?" work only without U parameter.
".*?" without /U parameter is ungreedy like ".*" with /U parameter. The 
result should be the same if all the expression should be ungreedy.

I think we are close to find a patch working for everybody.
Is your template text based, HTML based or both?

Thanks,

Nicolas

_______________________________________________
Glpi-dev mailing list
[email protected]
https://mail.gna.org/listinfo/glpi-dev

Reply via email to