Ticket #8886 (confirmed Bug)

Opened 2 years ago

Last modified 4 weeks ago

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

http://php.net/manual/en/function.htmlentities.php 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

test_case.zip (1.9 KB) - added by mkesicki 2 years ago.

Change History

comment:1 Changed 2 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 (http://www.php.net/manual/en/ini.core.php#ini.default-charset) which can be set only once by the main application

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

comment:2 Changed 2 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 2 years ago by mkesicki

comment:3 Changed 2 years ago by mkesicki

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

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

comment:4 Changed 2 years ago by mkesicki

  • Status changed from new to confirmed

comment:5 Changed 4 weeks ago by wwalc

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