소스 검색

In the search string, * (asterisk) can work anywhere except at the end of the string.

root 6 달 전
부모
커밋
2738089947
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      html/inc/common.php

+ 1 - 1
html/inc/common.php

@@ -292,7 +292,7 @@ function replaceSpecialChars($input) {
     // Заменяем ? на _ в любом месте
     $result = str_replace('?', '_', $input);
     // Заменяем * на % только в начале и конце с помощью регулярного выражения
-    $result = preg_replace('/^\*|\*$/', '%', $result);
+    $result = preg_replace('/\*(?=.*.)/', '%', $result);
     return $result;
 }