PHP error for url with trailing slash

Created on 5 July 2023, over 1 year ago

Problem/Motivation

PHP error for url ending with a slash '/'.

Warning: Trying to access array offset on value of type bool in Drupal\link_no_protocol\Plugin\Field\FieldWidget\NoProtocolLinkWidget::getUserEnteredStringAsUri() (line 71 of modules/contrib/link_no_protocol/src/Plugin/Field/FieldWidget/NoProtocolLinkWidget.php).

Deprecated function: gethostbyname(): Passing null to parameter #1 ($hostname) of type string is deprecated in Drupal\link_no_protocol\Plugin\Field\FieldWidget\NoProtocolLinkWidget::validateDomain() (line 93 of modules/contrib/link_no_protocol/src/Plugin/Field/FieldWidget/NoProtocolLinkWidget.php).

Steps to reproduce

- install module
- enable widget for a link field
- enter a url with a trailing slash like 'www.google.ch/'
- try to save the node

🐛 Bug report
Status

Active

Component

Code

Created by

🇨🇭Switzerland piridium

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

Comments & Activities

Production build 0.71.5 2024