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)enasledeLaysBetenemailstoavoidSpamflagssspamflags.3))

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 - Minimalist GNU for Windows
這個專案正在遷移到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應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中