Issue 806 - /Pluf/Template.php (pluf)

0 views
Skip to first unread message

no-r...@ceondo.com

unread,
May 8, 2012, 11:38:04 AM5/8/12
to pluf-u...@googlegroups.com
Hello,

A new issue has been created and assigned
to you:

806 - /Pluf/Template.php
Project: Pluf Framework
Status: New
Reported by: Jürgen Hörmann
Labels:
Priority:Medium
Type:Defect

Description:

Hello.

There is a problem with the htmspecialchars() call on line 232 of pluf/src/Pluf/Template.php

If the input string in $mixed contains German Umlauts or other non-ASCII chars that are NOT encoded in UTF, the call of htmlspecialchars will fail with this error:
htmlspecialchars(): Invalid multibyte sequence in argument

you have to validate the input before putting it into this function:

Replace in lines 232 and 236
htmlspecialchars($mixed, ENT_COMPAT, 'UTF-8')

with
htmlspecialchars(
((!mb_detect_encoding($mixed, 'UTF-8', true) )
? iconv(mb_detect_encoding($mixed, "auto", true), "UTF-8", $mixed)
: $mixed)
, ENT_COMPAT, 'UTF-8')

This works for me.

--
Issue: http://projects.ceondo.com/p/pluf/issues/806/


Reply all
Reply to author
Forward
0 new messages