Page MenuHomePhabricator

PHP Notice: Trying to access array offset on value of type null in /var/www/wiki/vendor/wikimedia/less.php/lib/Less/Parser.php on line 1927
Closed, ResolvedPublic

Description

There are records in php error log files like

PHP Notice: Trying to access array offset on value of type null in /var/www/wiki/vendor/wikimedia/less.php/lib/Less/Parser.php on line 1927

Mediawiki 1.34.0 and PHP 7.4.7 are used. The similar code is in 1.34.2 too.

if($op) condition is handled above but if( !$op ) did not, so here is error:

return $this->NewObj3('Less_Tree_Attribute',array( $key, $op[0], $val));

Please fix it in further versions.

Event Timeline

@Absorbcium: Thanks for taking a look at the code! You are very welcome to use developer access to submit the proposed code changes as a Git branch directly into Gerrit which makes it easier to review and provide feedback. If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again!

Given that MediaWiki 1.34.0 uses version 1.8.0, and 1.35.0 uses 3.0.0, this may already have been resolved.

You might want to report the issue on github too, as it appears that is the place bugs for the less.php library are handled.

@Aklapper, thank you for replay and invitation. I'll try it when I can reproduce this bug or another bug and test fix also in older PHP versions.

Assuming this is obsolete per Mainframe98's comment. If it is not, then please reopen with version info.