Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
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
frobComment #4
frobComment #5
frobComment #6
dwwCool, looks good. Thanks!
Comment #7
dwwComment #9
dww