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;
      }
    }
Command icon 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

guilherme-lima-almeida’s picture

StatusFileSize
new1009 bytes
guilherme-lima-almeida’s picture

Status: Active » Needs review

abhishek_gupta1’s picture

Status: Needs review » Reviewed & tested by the community

@RandallKent, tested locally above MR and patch are working for me, moving RTBC++

malcomio made their first commit to this issue’s fork.

malcomio’s picture

Status: Reviewed & tested by the community » Fixed

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.