Problem/Motivation

Warning: in_array() expects parameter 2 to be array, null given in _pathologic_replace() (line 164 of modules/contrib/pathologic/pathologic.module)

       // Default value is ['http', 'https', 'files', 'internal']
       // "files" and "internal" are for Path Filter compatibility.
-      && !in_array($parts['scheme'], \Drupal::config('pathologic.settings')->get('scheme_whitelist'))
+      && !in_array($parts['scheme'], \Drupal::config('pathologic.settings')->get('scheme_whitelist') ?? [])
     )
     // Bail out if it looks like there's only a fragment part.
     || (isset($parts['fragment']) && count($parts) === 1)

Steps to reproduce

Install module and remove configuration.

Proposed resolution

Add the null coalescing operator so it will at least be an empty array.

Issue fork pathologic-3216344

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frob created an issue. See original summary.

frob’s picture

Issue summary: View changes

frob’s picture

Status: Active » Needs review
frob’s picture

Assigned: frob » Unassigned
dww’s picture

Cool, looks good. Thanks!

dww’s picture

Status: Needs review » Reviewed & tested by the community

  • dww committed 71a45a6 on 8.x-1.x authored by frob
    Issue #3216344 by frob, dww: \Drupal::config returns null if the config...
dww’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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