php 8.1 deprecated

Created on 2 December 2022, about 2 years ago
Updated 13 February 2024, 10 months ago

Message Deprecated function: preg_quote(): Passing null to parameter #1 ($str) of type string is deprecated in Drupal\Core\Path\PathMatcher->matchPath() (line 80 of core/lib/Drupal/Core/Path/PathMatcher.php)

#0 /core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 core/lib/Drupal/Core/Path/PathMatcher.php(80): preg_quote()
#3 modules/eu_cookie_compliance/eu_cookie_compliance.module(834): Drupal\Core\Path\PathMatcher->matchPath()
#4 core/lib/Drupal/Core/Extension/ModuleHandler.php(562): eu_cookie_compliance_js_alter()

🐛 Bug report
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇴Norway svenryen

    I'm a bit puzzled by these lines in the call stack, compared to the reported version 2.0.x.

    First of all, we don't have line 834 or preg_quote in the code base for 2.0.x-dev.
    We do use preg_match in the 1.x version for both Drupal 7 and 8/9/10, so we should probably stress test these values a bit and see whether NULL is being passed sometimes.

  • Status changed to Closed: cannot reproduce about 1 year ago
  • 🇳🇴Norway svenryen

    I've gone through the code for D7 and D8/9/10 and I can't see any situation where we would pass null to any parameter of the preg_* functions.

    So I'll close this one for now. Feel free to reopen if you disagree.

  • I just got this with php 8.1.27 and eu_cookie_compliance 1.x-dev
    Deprecated function: preg_quote(): Passing null to parameter #1 ($str) of type string is deprecated in Drupal\Core\Path\PathMatcher->matchPath() (line 80 of /srv/web/aegir/platforms/cforge/web/core/lib/Drupal/Core/Path/PathMatcher.php)

    #0 /srv/web/aegir/platforms/cforge/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
    #1 [internal function]: _drupal_error_handler()
    #2 /srv/web/aegir/platforms/cforge/web/core/lib/Drupal/Core/Path/PathMatcher.php(80): preg_quote()
    #3 /srv/web/aegir/platforms/cforge/web/modules/eu_cookie_compliance/eu_cookie_compliance.module(849): Drupal\Core\Path\PathMatcher->matchPath()
    #4 /srv/web/aegir/platforms/cforge/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(562): eu_cookie_compliance_js_alter()

    The location according to admin/reports/dblog was /core/install.php/?rewrite=ok
    which was called by a bot, no doubt.
    No wonder you couldn't find it!

Production build 0.71.5 2024