Deprecation in Number::alphadecimalToInt()

Created on 23 April 2024, 2 months ago
Updated 30 April 2024, about 2 months ago

Problem/Motivation

Number::alphadecimalToInt() triggers a deprecation when called with a malformed string:

   DEPRECATED  Invalid characters passed for attempted conversion, these have been ignored in core/lib/Drupal/Component/Utility/Number.php on line 98.

Steps to reproduce

\Drupal\Component\Utility\Number::alphadecimalToInt("ร ");

Proposed resolution

The code should probably make sure substr($string, 1) returns a valid value before feeding it to base_convert().

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Baseย  โ†’

Last updated about 3 hours ago

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance prudloff Lille

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024