Error
Request ID: XHMiBQpAADkAADl36DUAAAAH
[{exception_id}] {exception_url} ErrorException from line 220 of /srv/mediawiki/php-1.33.0-wmf.18/extensions/ImageMap/includes/ImageMap.php: PHP Notice: A non well formed numeric value encountered
#0 /srv/mediawiki/php-1.33.0-wmf.18/extensions/ImageMap/includes/ImageMap.php(220) #1 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Parser.php(3987): ImageMap::render(string, array, Parser, PPTemplateFrame_DOM) #2 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/CoreParserFunctions.php(1098): Parser->extensionSubstitution(array, PPTemplateFrame_DOM) #3 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Parser.php(3515): CoreParserFunctions::tagObj(Parser, PPTemplateFrame_DOM, array) #4 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Parser.php(3222): Parser->callParserFunction(PPTemplateFrame_DOM, string, array) #5 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Preprocessor_DOM.php(1279): Parser->braceSubstitution(array, PPTemplateFrame_DOM) #6 /srv/mediawiki/php-1.33.0-wmf.18/extensions/ParserFunctions/includes/ExtParserFunctions.php(127): PPFrame_DOM->expand(DOMElement) #7 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Parser.php(3515): ExtParserFunctions::ifeqObj(Parser, PPTemplateFrame_DOM, array) #8 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Parser.php(3222): Parser->callParserFunction(PPTemplateFrame_DOM, string, array) #9 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Preprocessor_DOM.php(1279): Parser->braceSubstitution(array, PPTemplateFrame_DOM) #10 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Parser.php(3396): PPFrame_DOM->expand(DOMElement) #11 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Preprocessor_DOM.php(1279): Parser->braceSubstitution(array, PPTemplateFrame_DOM) #12 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Preprocessor_DOM.php(1729): PPFrame_DOM->expand(DOMElement, integer) #13 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Parser.php(3393): PPTemplateFrame_DOM->cachedExpand(string, PPNode_DOM) #14 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Preprocessor_DOM.php(1279): Parser->braceSubstitution(array, PPFrame_DOM) #15 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Parser.php(3036): PPFrame_DOM->expand(DOMElement, integer) #16 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Parser.php(1354): Parser->replaceVariables(string) #17 /srv/mediawiki/php-1.33.0-wmf.18/includes/parser/Parser.php(482): Parser->internalParse(string) #18 /srv/mediawiki/php-1.33.0-wmf.18/includes/content/WikitextContent.php(369): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL) #19 /srv/mediawiki/php-1.33.0-wmf.18/includes/content/AbstractContent.php(555): WikitextContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput) #20 /srv/mediawiki/php-1.33.0-wmf.18/includes/EditPage.php(4089): AbstractContent->getParserOutput(Title, NULL, ParserOptions) #21 /srv/mediawiki/php-1.33.0-wmf.18/includes/EditPage.php(3996): EditPage->doPreviewParse(WikitextContent) #22 /srv/mediawiki/php-1.33.0-wmf.18/includes/EditPage.php(2775): EditPage->getPreviewText() #23 /srv/mediawiki/php-1.33.0-wmf.18/includes/EditPage.php(719): EditPage->showEditForm() #24 /srv/mediawiki/php-1.33.0-wmf.18/includes/actions/EditAction.php(60): EditPage->edit() #25 /srv/mediawiki/php-1.33.0-wmf.18/includes/MediaWiki.php(501): EditAction->show() #26 /srv/mediawiki/php-1.33.0-wmf.18/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title) #27 /srv/mediawiki/php-1.33.0-wmf.18/includes/MediaWiki.php(867): MediaWiki->performRequest() #28 /srv/mediawiki/php-1.33.0-wmf.18/includes/MediaWiki.php(517): MediaWiki->main() #29 /srv/mediawiki/php-1.33.0-wmf.18/index.php(42): MediaWiki->run()
Impact
ImageMap does not currently prescribe what should happen if one of the coordinates in <imagemap> (in wikitext) is set as something invalid (not numerical).
What happens by accident now is that PHP encounters the invalid request to convert such string to an integer, logs this warning implicitly, and then pretends 0 was given and continues as normal.
Right now, this is logged as a problem with the software, whereas it should be logged (if at all) as a problem with the user input. That way it will not affect the perceived stability levels of our production cluster.
Notes
If the current accidental behaviour is intentional, we should validate the input with something like if ( ctype_digit( .. ) and explicitly default to 0.
This problem was first observed last week when the PHP 7 trials became public. PHP 7.2 is stricter than PHP 7.0 and HHVM in this regard.