loilo / Fuse

🔍 Fuzzy search for PHP, ported from Fuse.js
Apache License 2.0
326 stars 30 forks source link

preg_match fails when string has "/" in it #5

Closed akizor closed 6 years ago

akizor commented 6 years ago

loilo/fuse/src/Bitap/regex_search.php: 7

Example trace

  Fuse\Bitap\regex_search("R. Aazyol", "Atelier Richard Woodman Burbridge/Harrods", " +")
  vendor/loilo/fuse/src/Bitap/Bitap.php : 63
loilo commented 6 years ago

Thanks for reporting, I'll take a look. 👍

loilo commented 6 years ago

Okay, I simply forgot to escape slashes explicitely. Previously piped the search pattern through preg_quote which obviously doesn't catch slashes.

Should now be fixed in 3.2.3.

Thanks again for reporting. :)