Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0613f7d

Browse files
committed
escape function does not always take a string
1 parent 32e1400 commit 0613f7d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,16 @@ 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+
if (\is_string($value)) {
210+
$value = \addslashes($value);
211+
}
212+
if (\is_bool($value)) {
213+
$value = $value ? '1' : '0';
214+
}
215+
216+
return $value;
210217
}
211218

212219
private function addAttributes(array $attributes): string

0 commit comments

Comments
 (0)