8000 bug #30102 [Workflow] Graphviz dumper escape not always a string (Kor… · symfony/symfony@bac2c99 · GitHub
[go: up one dir, main page]

Skip to content

Commit bac2c99

Browse files
committed
bug #30102 [Workflow] Graphviz dumper escape not always a string (Korbeil)
This PR was merged into the 4.2 branch. Discussion ---------- [Workflow] Graphviz dumper escape not always a string | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A The `escape` function takes a string as parameter but it can be a `bool` (see `findTransitions` method in same class). In this PR I allow any type in `escape` and does escaping only for `string`. Commits ------- 1b17192 escape function does not always take a string
2 parents 02adcc3 + 1b17192 commit bac2c99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Workflow/Dumper/GraphvizDumper.php

Line 9268 s changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ protected function dotize($id)
204204
/**
205205
* @internal
206206
*/
207-
protected function escape(string $string): string
207+
protected function escape($value): string
208208
{
209-
return addslashes($string);
209+
return \is_bool($value) ? ($value ? '1' : '0') : \addslashes($value);
210210
}
211211

212212
private function addAttributes(array $attributes): string

0 commit comments

Comments
 (0)
0