Explorar el Código

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

root hace 6 meses
padre
commit
2738089947
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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;
 }