Problem/Motivation
When redirect patterns are URL paths that contain slashes, hits to pages generate preg_match warnings. If there are a large number of redirects defined, this can cause the logs to fill up pretty quickly, especially when hackers keep trying to access xmlrpc.php or any number of other pages that don't exist.
Steps to reproduce
- Go to /admin/config/broken_link_redirect and create a redirect - use a file path that contains a / in the pattern
- Try to access a page that does not exist (our example was xmlrpc.php)
- Review the DB logs - there will be a warning about an unknown modifier from the preg_match function
Proposed resolution
Escape slashes in the pattern before calling preg_match. I have included a patch for this.
| Comment | File | Size | Author |
|---|---|---|---|
| broken_link_preg_match_warnings.patch | 562 bytes | cobblestone.consulting |
Comments
Comment #2
cobblestone.consulting commented