1
0
Эх сурвалжийг харах

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

root 6 сар өмнө
parent
commit
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;
 }