Opened 17 years ago

Closed 16 years ago

#888 closed Bug (fixed)

IE6 can't display file browser using PHP connector

Reported by: Miguelangel Da Vila Owned by: Wiktor Walc
Priority: Normal Milestone: FCKeditor 2.5 Beta
Component: Server : PHP Version: SVN (FCKeditor) - Retired
Keywords: Cc:


After updating to 2.4.3 the php connector stops to display the file manager.

It displays an alert saying that the request error is OK 200 (actually this is not an error it reads OK and 200 is the code to inform that the resource exists). Also includes a very large message (it is not useful).

The version 2.4.2 works fine in the same systems.

Change History (8)

comment:1 Changed 17 years ago by Miguelangel Da Vila

This hapens only with IE6 in all pc's I tested

comment:2 Changed 17 years ago by Miguelangel Da Vila

Seems the error was caused by filenames with spaces in the directory, I deleted it and starts to work.

May be the line 39 in utipl.php is the cause:

return utf8_encode( htmlspecialchars( $value ) ) ;

in the version 2.4.3 the utf8_encode() call was removed.

It is possible to include code in the connector to change bad characters by _ or - at uplading time?

comment:3 Changed 16 years ago by Alfonso Martínez de Lizarrondo

The call to utf8_encode was removed in #455 A better fix will be needed to cover both situations.

comment:4 Changed 16 years ago by Wiktor Walc

The problem is in PHP. PHP4 and PHP5 don't really support multibyte strings so functions like opendir, readdir will not work with "chinese" file names (until PHP6).

In fact it's a bit more complicated:

fortunately on linux (at least on two distributions I use: CentOs and Ubuntu) PHP is working fine with non ISO-8859-1 file names, so it's able to handle chinese folders and files (utf8_encode is not needed, so FCKeditor 2.4.3 is ok here).

...but Windows is different
here PHP seems to use only ISO-8859-1 to open directories, so having directory or file with different encoding will cause the following error:

Warning: filesize() [function.filesize]: stat failed for each file with wrong name.

and, additionally, we will have broken string in XML file, that will cause troubles in IE6/7. (btw. this warning message is also being sent in XML response right now :))

My proposal is: detect somehow (using $_ENV and $_SYSTEM variables) on which OS our server is running and if we are running on Windows, let's add back utf8_encode in ConvertToXmlAttribute function.

I know it would break encoding in some occasions, but it's always better than displaying error message or nothing.

Additionally, we should modify code a bit in GetFoldersAndFiles to handle potential errors with getting file size:

$iFileSize = @filesize( $sServerDir . $sFile ) ;
if (!$iFileSize) {
    $iFileSize = 0;

If you agree with me, I'll make these changes in SVN.

comment:5 Changed 16 years ago by Wiktor Walc

Milestone: FCKeditor 2.5
Owner: changed from Frederico Caldeira Knabben to Wiktor Walc
Version: FCKeditor 2.4.3SVN

comment:6 Changed 16 years ago by Frederico Caldeira Knabben

I think that this is the way to go Wiktor. For me, you can proceed with it.

comment:7 Changed 16 years ago by Alfonso Martínez de Lizarrondo

I'm sure that it's quite better than anything I can think of given my low knowledge about PHP.

comment:8 Changed 16 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

Ok, code modified in [759]. Let's keep our fingers crossed :)

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