Opened 5 years ago

Last modified 3 years ago

#8886 confirmed Bug

htmlspecialchars() calls will return an empty string under certain conditions

Reported by: bugmenot Owned by:
Priority: Normal Milestone:
Component: Server : PHP Version:
Keywords: Cc:

Description Like htmlspecialchars(), htmlentities() takes an optional third argument encoding which defines encoding used in conversion. If omitted, the default value for this argument is ISO-8859-1 in versions of PHP prior to 5.4.0, and UTF-8 from PHP 5.4.0 onwards. Although this argument is technically optional, you are highly encouraged to specify the correct value for your code.

In case of PHP 5.4 environment htmlspecialchars() will return an empty string when supplied with a text in non-default encoding (UTF-8) and no exact encoding specified in third argument. So you need to implement an ability to pass text encoding name to editor() method somehow.

Attachments (1) (1.9 KB) - added by mkesicki 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 5 years ago by bugmenot

htmlspecialchars() may be called with an empty string as a third argument so it will rely on global default_encoding setting ( which can be set only once by the main application

Last edited 5 years ago by bugmenot (previous) (diff)

comment:2 Changed 5 years ago by mkesicki

@bugmenot can you give us some test case or example text that cause problems ? This helps us test and resolve this issue faster.

Changed 5 years ago by mkesicki

comment:3 Changed 5 years ago by mkesicki

I have attached This test case fails on PHP 5.4. Please extract archive to CKEditor's _samples/php directory.

Last edited 5 years ago by j.swiderski (previous) (diff)

comment:4 Changed 5 years ago by mkesicki

  • Status changed from new to confirmed

comment:5 Changed 3 years ago by wwalc

  • Keywords PHP 5.4 htmlspecialchars encoding removed
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy