Skip to content

Commit 2acdb0c

Browse files
committed
To escape quotes, we must double them
1 parent 2028a51 commit 2acdb0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/DoctrineAnnotationDumper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use function is_array;
1111
use function is_numeric;
1212
use function is_string;
13+
use function str_replace;
1314
use function var_export;
1415

1516
class DoctrineAnnotationDumper
@@ -35,7 +36,7 @@ private static function innerExportValues($item, bool $first): string
3536
return 'null';
3637
}
3738
if (is_string($item)) {
38-
return '"'.addslashes($item).'"';
39+
return '"'.str_replace('"', '""', $item).'"';
3940
}
4041
if (is_numeric($item)) {
4142
return $item;

0 commit comments

Comments
 (0)