PHP fck folder and upload pictures in Chinese garbled problem solving method
The main reason is FCK in the compilation ( Utf-8 ) code and local code (GBK) The ring tightness is caused, modify the following 5 files can be resolved.
Solve the Chinese folder garbled problem:
file 1 : \fckeditor\editor\filemanager\browser\default\browser.html
Found it
Oconnector.sendcommand = function (command, params, callbackfunction)
{
?????? var sURL = this. Connectorurl + ' command= ' + Command;
?????? sURL + = ' &type= ' + this. ResourceType;
//???? sURL + = ' ¤tfolder= ' + encodeuricomponent (this. CurrentFolder);
?????? sURL + = ' ¤tfolder= ' +? This. CurrentFolder; ?
?
?????? if (params) sURL + = ' & ' + params;
?
?????? Add a random salt to avoid getting a cached version of the command execution
?????? sURL + = ' &uuid= ' + new Date (). GetTime ();
?
?????? var oxml = new Fckxml ();
?
?????? if (callbackfunction)
????????????? Oxml.loadurl (sURL, callbackfunction); ?? Asynchronous load.
?????? Else
????????????? Return Oxml.loadurl (sURL);
?
?????? return null;
}
Remove encodeURIComponent function.
?
file 2 : \fckeditor\editor\filemanager\browser\default\frmcreatefolder.html
Found it
function CreateFolder ()
{
?????? var sfoldername;
?
?????? while (true)
?????? {
????????????? Sfoldername = Prompt (' Type The name of the new folder: ', ');
?
????????????? if (Sfoldername = = null)
???????????????????? return;
????????????? else if (sfoldername.length = = 0)
???????????????????? Alert (' Please type the folder name ');
????????????? Else
???????????????????? break;
?????? }
?
//???? Oconnector.sendcommand (' CreateFolder ', ' newfoldername= ' + encodeuricomponent (sfoldername), CreateFolderCallBack);
?????? Oconnector.sendcommand (' CreateFolder ', ' newfoldername= ' + sfoldername, createfoldercallback);
}
Remove encodeURIComponent function.
?
file 3 : \fckeditor\editor\filemanager\browser\default\frmresourceslist.html
Found it
function OpenFile (FILEURL)
{
//???? WINDOW.TOP.OPENER.SETURL (encodeURI (FILEURL). replace (' # ', '%23 '));
?????? WINDOW.TOP.OPENER.SETURL (FILEURL);
?????? Window.top.close ();
?????? Window.top.opener.focus ();
}
Remove encodeURI function.
?
Solve the problem of uploading pictures in Chinese file name garbled:
file 4 : \fckeditor\editor\filemanager\connectors\php\commands.php
Found it
function FileUpload ($resourceType, $currentFolder, $sCommand) {
。。。
? ??? Find
? ??? Move_uploaded_file ($oFile [' Tmp_name '], $sFilePath);
Move_uploaded_file ($oFile [' Tmp_name '], Iconv ("Utf-8", "GBK", $sFilePath));
}
to the file name $sFilePath transcoding.
?
file 5 : \fckeditor\editor\filemanager\connectors\php\util.php
Found it
function Converttoxmlattribute ($value) {
?????? .....
?????? Find
? ???? Return (Utf8_encode (Htmlspecialchars ($value)));
?????? return Iconv ("GBK", "UTF-8", Htmlspecialchars ($value));
}
Transcode the content.
?
The original blog has mentioned the relevant issues: http://simpledev.iteye.com/blog/371619
(see: Attachments directly overwrite files)
Finishing 120521 15:06
?