Skip to content

Commit dbb9957

Browse files
authored
Cast attr to string to prevent a PHP deprecation warning in 8.1 (#365)
* Cast attr to string to prevent a PHP deprecation warning in 8.1 * Update the call to preg_match_all to coalesce an empty string on $attr
1 parent 5161316 commit dbb9957

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Michelf/MarkdownExtra.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ protected function doExtraAttributes($tag_name, $attr, $defaultIdValue = null, $
229229
}
230230

231231
// Split on components
232-
preg_match_all('/[#.a-z][-_:a-zA-Z0-9=]+/', $attr, $matches);
232+
preg_match_all('/[#.a-z][-_:a-zA-Z0-9=]+/', $attr ?? '', $matches);
233233
$elements = $matches[0];
234234

235235
// Handle classes and IDs (only first ID taken into account)

0 commit comments

Comments
 (0)