|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-06 11:26 UTC] nicos@php.net
[2003-08-06 11:39 UTC] php-bug-NOSPAM-2003-aug-05 at ryandesign dot de
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 05:00:01 2025 UTC |
Description: ------------ If I use the chars quote, backslash, or newline in labels passed to Image_GraphViz's functions addNode et al, the resulting GraphViz markup is syntactically invalid and the graph it produces does not look visually like what I intended it to look like. Reproduce code: --------------- <?php require "Image/GraphViz.php"; $g = new Image_GraphViz(); $g->addNode(1, array('label' => 'Node "One" 2nd line')); $g->image('png'); ?> Expected result: ---------------- Expected: graph with one node whose label spans 2 lines and looks like this: Node "One" 2nd line Actual result: -------------- Actual: graph with one node whose label spans only one line and looks like this: Node I can get the desired result by instead writing... $g->addNode(1, array('label' => 'Node \"One\"\n2nd line')); ...but as the user of the Image_GraphViz class I shouldn't have to know GraphViz's escaping rules. The class should handle this for me -- probably in its parse() function.