-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
The current code assumes that elements are always arrays:
drupal-finder/src/DrupalFinder.php
Lines 205 to 211 in 9f16035
| if (is_array($json)) { | |
| if (isset($json['extra']['installer-paths']) && is_array($json['extra']['installer-paths'])) { | |
| foreach ($json['extra']['installer-paths'] as $install_path => $items) { | |
| if (in_array('type:drupal-core', $items) || | |
| in_array('drupal/core', $items) || | |
| in_array('drupal/drupal', $items)) { |
However, upstream "allows" simple strings by casting to array:
Predictably, this causes a crash:
PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /webflo/drupal-finder/src/DrupalFinder.php:113
Stack trace:
#0 webflo/drupal-finder/src/DrupalFinder.php(113): in_array('type:drupal-cor...', 'a-module-name-im-using...')
Whether to follow upstream or not, it would be best to avoid the crash since strings instead of arrays is "not wrong" (?).
Metadata
Metadata
Assignees
Labels
No labels