Browse Source

查询首选意思的时候去掉格尾

visuddhinanda 5 years ago
parent
commit
ffe220b9c6
2 changed files with 2 additions and 0 deletions
  1. 1 0
      app/dict/dict.js
  2. 1 0
      app/dict/function.php

+ 1 - 0
app/dict/dict.js

@@ -301,6 +301,7 @@ function getPartMeaning(word = "") {
 	if (word == "") {
 		sWord = $("#dict_ref_search_input").val();
 	}
+
 	$.get(
 		"../dict/get_first_mean.php",
 		{

+ 1 - 0
app/dict/function.php

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