Explorar o código

:bug: 判断是否有[

visuddhinanda %!s(int64=5) %!d(string=hai) anos
pai
achega
d53a832601
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      app/dict/function.php

+ 3 - 1
app/dict/function.php

@@ -4,7 +4,9 @@ require_once '../public/_pdo.php';
 require_once '../redis/function.php';
 
 function getRefFirstMeaning($word,$lang,$redis){
-	$word = strstr($word,"[",true);
+	if(strpos($word,"[")){
+		$word = strstr($word,"[",true);
+	}
 	if($redis!==false){
 		if(mb_substr($word,0,1,"UTF-8")==="["){
 			$ending = "-".mb_substr($word,1,-1,"UTF-8");