Page MenuHomePhabricator

<ref> <gallery> invalid </gallery></ref> creates MWException on Wikipedia but not on Wikibooks
Closed, ResolvedPublic

Description

Both on production site and beta.wmflabs.org.

Exception from line 77 of /srv/common-local/php-master/includes/parser/StripState.php: Invalid marker: UNIQ37d9b76ed39af705-gallery-00000003-QINU

Backtrace:

#0 /srv/common-local/php-master/includes/parser/StripState.php(66): StripState->addItem(string, string, string)
#1 /srv/common-local/php-master/includes/parser/Parser.php(4164): StripState->addGeneral(string, string)
#2 /srv/common-local/php-master/includes/parser/Preprocessor_DOM.php(1258): Parser->extensionSubstitution(array, PPFrame_DOM)
#3 /srv/common-local/php-master/includes/parser/Parser.php(3246): PPFrame_DOM->expand(DOMElement, integer)
#4 /srv/common-local/php-master/includes/parser/Parser.php(1239): Parser->replaceVariables(string)
#5 /srv/common-local/php-master/includes/parser/Parser.php(612): Parser->internalParse(string, boolean, boolean)
#6 /srv/common-local/php-master/extensions/Cite/Cite_body.php(670): Parser->recursiveTagParse(string)
#7 /srv/common-local/php-master/extensions/Cite/Cite_body.php(1071): Cite->referencesFormat(string)
#8 /srv/common-local/php-master/includes/Hooks.php(206): Cite->checkRefsNoReferences(boolean, Parser, string)
#9 /srv/common-local/php-master/includes/GlobalFunctions.php(3975): Hooks::run(string, array, NULL)
#10 /srv/common-local/php-master/includes/parser/Parser.php(406): wfRunHooks(string, array)
#11 /srv/common-local/php-master/includes/StubObject.php(105): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#12 /srv/common-local/php-master/includes/StubObject.php(125): StubObject->_call(string, array)
#13 /srv/common-local/php-master/includes/content/WikitextContent.php(327): StubObject->__call(string, array)
#14 /srv/common-local/php-master/includes/content/AbstractContent.php(486): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#15 /srv/common-local/php-master/includes/poolcounter/PoolWorkArticleView.php(139): AbstractContent->getParserOutput(Title, integer, ParserOptions)
#16 /srv/common-local/php-master/includes/poolcounter/PoolCounterWork.php(123): PoolWorkArticleView->doWork()
#17 /srv/common-local/php-master/includes/page/Article.php(688): PoolCounterWork->execute()
#18 /srv/common-local/php-master/includes/actions/ViewAction.php(44): Article->view()
#19 /srv/common-local/php-master/includes/MediaWiki.php(439): ViewAction->show()
#20 /srv/common-local/php-master/includes/MediaWiki.php(307): MediaWiki->performAction(Article, Title)
#21 /srv/common-local/php-master/includes/MediaWiki.php(609): MediaWiki->performRequest()
#22 /srv/common-local/php-master/includes/MediaWiki.php(460): MediaWiki->main()
#23 /srv/common-local/php-master/index.php(46): MediaWiki->run()
#24 /srv/common-local/w/index.php(3): include(string)
#25 {main}


Version: wmf-deployment
Severity: normal

Details

Reference
bz69348

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:35 AM
bzimport set Reference to bz69348.
bzimport added a subscriber: Unknown Object (MLST).

It's also observed that disabling tracking category 'broken-file-category' (setting it to '-' or an invalid title) workarounds this bug.

Liangent: So this is about literally writing

<ref> <gallery> invalid </gallery></ref>

as wikitext?

(In reply to Andre Klapper from comment #2)

Liangent: So this is about literally writing

<ref> <gallery> invalid </gallery></ref>

as wikitext?

Yup. Trying to save this as the content of a wiki page triggers a MWException.

If such a revision has been saved previously (for example when "invalid" was a valid file name),

  • action=purge the page makes it not viewable (MWException)
  • trying to view the problematic revision with oldid= specified works (even if it's the current revision)
Umherirrender edited subscribers, added: Umherirrender; removed: wikibugs-l-list.

Works now / Cannot reproduce

Seems to be fix in the Cite extension (would say that it was a problem of the Cite extension by holding different StripState objects on parse, so https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/556384 could have fixed it, but not confirmed)