php fck文件夹及上传图片中文乱码问题解决方法
主要原因是fck中的编(utf-8)码和本地的编码(gbk)环紧不一致导致的,修改如下5个文件可以解决。
解决中文文件夹乱码问题:
文件1:\fckeditor\editor\filemanager\browser\default\browser.html
找到
oConnector.SendCommand = function( command, params, callBackFunction )
{
?????? var sUrl = this.ConnectorUrl + 'Command=' + command ;
?????? sUrl += '&Type=' + this.ResourceType ;
//???? sUrl += '&CurrentFolder=' + encodeURIComponent( this.CurrentFolder ) ;
?????? sUrl += '&CurrentFolder=' +? 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 ;
}
去掉encodeURIComponent函数。
?
文件2:\fckeditor\editor\filemanager\browser\default\frmcreatefolder.html
找到
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 ) ;
}
去掉encodeURIComponent函数。
?
文件3:\fckeditor\editor\filemanager\browser\default\frmresourceslist.html
找到
function OpenFile( fileUrl )
{
//???? window.top.opener.SetUrl( encodeURI( fileUrl ).replace( '#', '%23' ) ) ;
?????? window.top.opener.SetUrl( fileUrl ) ;
?????? window.top.close() ;
?????? window.top.opener.focus() ;
}
去掉encodeURI函数。
?
解决上传图片中文文件名乱码问题:
文件4:\fckeditor\editor\filemanager\connectors\php\commands.php
找到
function FileUpload( $resourceType, $currentFolder, $sCommand ){
。。。
? ??? 找到
? ??? //move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;
move_uploaded_file( $oFile['tmp_name'], iconv("utf-8","gbk",$sFilePath));
}
对文件名$sFilePath转码。
?
文件5:\fckeditor\editor\filemanager\connectors\php\util.php
找到
function ConvertToXmlAttribute( $value ){
?????? 。。。
?????? 找到
????? //return ( utf8_encode( htmlspecialchars( $value ) ) ) ;
?????? return iconv("GBK", "UTF-8", htmlspecialchars( $value ));
}
对内容进行转码。
?
原来的本人博客中有提到相关问题:http://simpledev.iteye.com/blog/371619
(详见:附件直接覆盖文件)
整理 120521 15:06
?

DependencyInjection(DI)inPHPenhancescodeflexibilityandtestabilitybydecouplingdependencycreationfromusage.ToimplementDIeffectively:1)UseDIcontainersjudiciouslytoavoidover-engineering.2)Avoidconstructoroverloadbylimitingdependenciestothreeorfour.3)Adhe

到Improveyourphpwebsite的实力,UsEthestertate:1)emplastOpCodeCachingWithOpcachetCachetOspeedUpScriptInterpretation.2)优化的atabasequesquesquesquelies berselectingOnlynlynnellynnessaryfields.3)usecachingsystemssslikeremememememcachedisemcachedtoredtoredtoredsatabaseloadch.4)

是的,itispossibletosendMassemailswithp.1)uselibrarieslikeLikePhpMailerorSwiftMailerForeffitedEmailSending.2)enasledeLaysBetemailStoavoidSpamflagssspamflags.3)sylectynamicContentToimpovereveragement.4)

DependencyInjection(DI)inPHPisadesignpatternthatachievesInversionofControl(IoC)byallowingdependenciestobeinjectedintoclasses,enhancingmodularity,testability,andflexibility.DIdecouplesclassesfromspecificimplementations,makingcodemoremanageableandadapt

使用PHP发送电子邮件的最佳方法包括:1.使用PHP的mail()函数进行基本发送;2.使用PHPMailer库发送更复杂的HTML邮件;3.使用SendGrid等事务性邮件服务提高可靠性和分析能力。通过这些方法,可以确保邮件不仅到达收件箱,还能吸引收件人。

计算PHP多维数组的元素总数可以使用递归或迭代方法。1.递归方法通过遍历数组并递归处理嵌套数组来计数。2.迭代方法使用栈来模拟递归,避免深度问题。3.array_walk_recursive函数也能实现,但需手动计数。

在PHP中,do-while循环的特点是保证循环体至少执行一次,然后再根据条件决定是否继续循环。1)它在条件检查之前执行循环体,适合需要确保操作至少执行一次的场景,如用户输入验证和菜单系统。2)然而,do-while循环的语法可能导致新手困惑,且可能增加不必要的性能开销。

在PHP中高效地哈希字符串可以使用以下方法:1.使用md5函数进行快速哈希,但不适合密码存储。2.使用sha256函数提高安全性。3.使用password_hash函数处理密码,提供最高安全性和便捷性。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

SublimeText3 Linux新版
SublimeText3 Linux最新版

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中