Html: Fix "substr(): Passing null to parameter #1 ($string) of type string is deprecated"

Bug: T388944
Change-Id: Iaba9973aa774f0bac9cf56efc76bc249d4f578ee
(cherry picked from commit e3dd105b209597ccff5eb8a39e79bdc75c1a9b8a)
This commit is contained in:
Paladox 2025-03-17 13:40:57 +00:00 committed by Jforrester
parent fe57b122b5
commit e3403e20e2

View file

@ -847,7 +847,7 @@ class Html {
public static function textarea( $name, $value = '', array $attribs = [] ) {
$attribs['name'] = $name;
if ( substr( $value, 0, 1 ) == "\n" ) {
if ( substr( $value ?? '', 0, 1 ) == "\n" ) {
// Workaround for T14130: browsers eat the initial newline
// assuming that it's just for show, but they do keep the later
// newlines, which we may want to preserve during editing.