Skip to content

Commit cdd2584

Browse files
committed
add url js, fix bug
1 parent c0c1dda commit cdd2584

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/controller/InstallDBController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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;

src/public/js/im/zalyMsg.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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=/((http|ftp|https):\/\/)?[\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

964979
function 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,

0 commit comments

Comments
 (0)