Permalink
Browse files

bug #30102 [Workflow] Graphviz dumper escape not always a string (Kor…

…beil)

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
  • Loading branch information...
lyrixx committed Feb 8, 2019
2 parents 02adcc3 + 1b17192 commit bac2c99733106e13a760d930c97a141c081995bb
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Symfony/Component/Workflow/Dumper/GraphvizDumper.php
@@ -204,9 +204,9 @@ protected function dotize($id)
/**
* @internal
*/
protected function escape(string $string): string
protected function escape($value): string
{
return addslashes($string);
return \is_bool($value) ? ($value ? '1' : '0') : \addslashes($value);
}
private function addAttributes(array $attributes): string

0 comments on commit bac2c99

Please sign in to comment.