Opened 13 years ago

Last modified 11 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

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.

Find this issue on GitHub

Change History (6)

comment:1 Changed 13 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 13 years ago by bugmenot (previous) (diff)

comment:2 Changed 13 years ago by Michał

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

Changed 13 years ago by Michał

Attachment: test_case.zip added

comment:3 Changed 13 years ago by Michał

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 13 years ago by Jakub Ś (previous) (diff)

comment:4 Changed 13 years ago by Michał

Status: newconfirmed

comment:5 Changed 11 years ago by Wiktor Walc

Keywords: PHP 5.4 htmlspecialchars encoding removed
Find this issue on GitHub
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy