Change preg_match delimiter from"|" to something else

Created on 16 August 2025, 4 days ago

Easy breadcumps uses "|" as preg_match delimiter in EasyBreadcrumbBuilder.php. This prevents using the vertical bar to form patterns like (abc|def) and according to what follows | (in my exemple "d") it will throw a "Warning : preg_match(): Unknown modifier 'd' etc."

I suggest using "!" instead of "|".

      if (
        ($is_regex && preg_match("!" . $custom_path . "!", $path, $regex_group_matches))
        || ($is_regex && preg_match("!" . $custom_path . "!", $internal_path, $regex_group_matches))
        || (!$is_regex && $path == $custom_path)
        || (!$is_regex && $internal_path == $custom_path)
      ) {
🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France erwangel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024