Undefined array key warning in UrlHelper::parse()

Created on 23 April 2024, about 1 year ago
Updated 24 April 2024, about 1 year ago

Problem/Motivation

Fuzzing reveals that UrlHelper::parse() throws a warning when called with some malformed strings:

   WARNING  Undefined array key 1 in core/lib/Drupal/Component/Utility/UrlHelper.php on line 200.

Steps to reproduce

\Drupal\Component\Utility\UrlHelper::parse('#/://#')

Proposed resolution

One solution could be to check if $parts[0] is empty before trying to use it in explode().

๐Ÿ› Bug report
Status

Active

Version

10.2 โœจ

Component
Baseย  โ†’

Last updated 10 minutes ago

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance prudloff Lille

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024