Opened 9 years ago

Last modified 7 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 Michał 9 years ago.

Download all attachments as: .zip

Change History (6)

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

comment:2 Changed 9 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 9 years ago by Michał

Attachment: added

comment:3 Changed 9 years ago by Michał

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

Last edited 9 years ago by Jakub Ś (previous) (diff)

comment:4 Changed 9 years ago by Michał

Status: newconfirmed

comment:5 Changed 7 years ago by Wiktor Walc

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