Page MenuHomePhabricator

GraphViz double-encodes entities in URLs
Closed, ResolvedPublic

Description

The graph code below incorrectly results in a link like http://localhost/mediawiki/index.php?title=Test_page&action=edit&preload=template:test/preload

<graphviz>
digraph test {
  test_node [label="This is a test", URL="[http://localhost/mediawiki/index.php?title=Test_page&action=edit&preload=template:test/preload Testing]"]
}
</graphviz>

I think this is because the output of dot -Tcmapx already has HTML entities encoded, and then ImageMap::render encodes them again.

It seems a fix may live in GraphViz::normalizeMapFileContents.

Event Timeline

Change 322834 had a related patch set uploaded (by Samwilson):
Prevent double-encoding of URLs that were output by the 'dot' command

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

Thanks for reporting!

I confirmed 'dot -Tcmapx' encodes HTML entities in URLs but 'mscgen -T ismap' does not. So GraphViz graph renderers are affected by this problem but the mscgen message sequence chart renderer is not affected.

Samwilson triaged this task as Medium priority.Jan 1 2017, 11:30 PM

Change 322834 merged by jenkins-bot:
Prevent double-encoding of URLs that were output by the 'dot' command

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

Kghbln subscribed.

I believe this improvement was released together with Graphviz 2.0.0 (78f8598) 20:50, 10 April 2017. Thanks for all your effort!

Change 348522 had a related patch set uploaded (by Welterkj):
[mediawiki/extensions/GraphViz@master] Re-write the fix for T151294 which caused all graph links to be the same.

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

Change 348522 merged by jenkins-bot:
[mediawiki/extensions/GraphViz@master] Re-write the fix for T151294 which caused all graph links to be the same.

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