Page MenuHomePhabricator

Dot Quoted String regex is broken
Closed, ResolvedPublic

Description

Error

The quoted string regex cannot handle the syntax [image="<path>", label="<label>"] because it parses the image path to be "<path>", label="<label>"". I have a fix ready, please advice how to proceed.

message
trace
3.7570   4.0M  MediaWiki\Extension\GraphViz\GraphRenderParms::__construct: userName: GraphViz graphName: Main_Page_digraph_example3
3.7585   4.0M  MediaWiki\Extension\GraphViz\GraphRenderParms::__construct: sourceAndMapDir: D:\OSGWiki\MediaWikiCore\MediaWiki.WebRole\MediaWikiWeb\images\graphviz\ imageDir: D:\OSGWiki\MediaWikiCore\MediaWiki.WebRole\MediaWikiWeb\images\graphviz\images\
3.7599   4.0M  MediaWiki\Extension\GraphViz\GraphRenderParms::__construct: renderer: dot imageType: png
3.7619   4.0M  MediaWiki\Extension\GraphViz\GraphViz::render: isPreview: 1
3.7641   4.0M  MediaWiki\Extension\GraphViz\GraphViz::render: preParseType: none doRecursiveTagParse:
3.7660   4.0M  MediaWiki\Extension\GraphViz\GraphViz::fixImageName: removing invalid imageName: Microsoft-logo-7.png", label="

Impact

Notes

Details

Related Gerrit Patches:
mediawiki/extensions/GraphViz : masterFix quoted string regex for dot language

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 17 2018, 12:51 AM

I have a fix ready, please advice how to proceed.

@osorio-juan-microsoft: Thanks for reporting this, welcome to Wikimedia Phabricator, and 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 them quickly and provide feedback. (If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader.) Thanks again!

Change 468055 had a related patch set uploaded (by Juan Osorio (Microsoft); owner: Juan Osorio (Microsoft)):
[mediawiki/extensions/GraphViz@master] Fix quoted string regex for dot language

https://gerrit.wikimedia.org/r/468055

@Samwilson Thanks for all the help! I've added a test alongside the fix. Is anything missing for getting it merged?

Looks great! Sorry I didn't get it reviewed last night. I was having some issues with my local setup. Will hopefully get to it after work today, if no one merges it before then.

Change 468055 merged by jenkins-bot:
[mediawiki/extensions/GraphViz@master] Fix quoted string regex for dot language

https://gerrit.wikimedia.org/r/468055