Problem/Motivation
Drupal: 10.0.11
PHP: 8.1.27
DB: 5.7.42-46-log
I am getting this error when I put my site on maintenance mode:
Deprecated function: preg_quote(): Passing null to parameter #1 ($str) of type string is deprecated in Drupal\Core\Path\PathMatcher->matchPath() (line 82 of /Drupal/Core/Path/PathMatcher.php)
Steps to reproduce
Proposed resolution
Change the code on the file MaintenanceModeExempt.php to validate that the field is not empty since this field is not required:
// Check if the URL should be exempted.
$exempt_urls = \Drupal::config('maintenance_exempt.settings')->get('exempt_urls');
if (!empty($exempt_urls)) {
// Check the actual URL.
$current_url = $this->request->getPathInfo();
if ($this->pathMatcher->matchPath($current_url, $exempt_urls)) {
return TRUE;
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | desprecated-function-3445879-1.patch | 1009 bytes | guilherme-lima-almeida |
Issue fork maintenance_exempt-3445879
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
guilherme-lima-almeidaComment #3
guilherme-lima-almeidaComment #5
abhishek_gupta1 commented@RandallKent, tested locally above MR and patch are working for me, moving RTBC++
Comment #8
malcomio commentedThanks