File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,9 +211,11 @@ public function doIndex()
211211 if (!$ doucmentRoot || !$ scriptRoot ) {
212212 $ isInstallRootPath = false ;
213213 }
214- if ($ doucmentRoot ."/index.php " != $ scriptRoot ) {
214+
215+ if ($ doucmentRoot .DIRECTORY_SEPARATOR ."index.php " != $ scriptRoot ) {
215216 $ isInstallRootPath = false ;
216217 }
218+
217219 if ($ isInstallRootPath === false ) {
218220 echo $ this ->lang == 1 ? "目前只支持根目录运行 " : "Currently only the root directory is supported. " ;
219221 return ;
Original file line number Diff line number Diff line change @@ -959,6 +959,21 @@ function base64ToBlob(base64, mime)
959959 return new Blob ( byteArrays , { type : mime } ) ;
960960}
961961
962+ function handleMsgContentText ( str )
963+ {
964+ var reg = / ( ( h t t p | f t p | h t t p s ) : \/ \/ ) ? [ \w \- _ ] + ( \. [ \w \- _ ] + ) + ( [ \w \- \. , @ ? ^ = % & : / ~ \+ # ] * [ \w \- \@ ? ^ = % & / ~ \+ # ] ) ? / ;
965+ var arr = str . match ( reg ) ;
966+ console . log ( "reg ===" + JSON . stringify ( arr ) ) ;
967+
968+ if ( arr == null ) {
969+ return str ;
970+ }
971+ var urlLink = arr . shift ( ) ;
972+ var urlLinkHtml = "<a href='" + urlLink + "'>" + urlLink + "</a>" ;
973+ str = str . replace ( urlLink , urlLinkHtml ) ;
974+ return str ;
975+ }
976+
962977//---------------------------------------------append msg html to chat dialog-------------------------------------------------
963978
964979function appendMsgHtmlToChatDialog ( msg )
@@ -986,6 +1001,7 @@ function appendMsgHtmlToChatDialog(msg)
9861001 switch ( msgType ) {
9871002 case MessageType . MessageText :
9881003 var msgContent = msg [ 'text' ] . body ;
1004+ msgContent = handleMsgContentText ( msgContent ) ;
9891005 html = template ( "tpl-send-msg-text" , {
9901006 roomType : msg . roomType ,
9911007 nickname :nickname ,
You can’t perform that action at this time.
0 commit comments