Skip to content

Commit 3d117c8

Browse files
author
premkamble
committed
Fix: correct regex for var_export string escaping
1 parent e5f1c1f commit 3d117c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/php/var/var_export.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ module.exports = function var_export(mixedExpression, boolReturn) {
127127
retstr =
128128
typeof mixedExpression !== 'string'
129129
? mixedExpression
130-
: "'" + mixedExpression.replace(/(["'])/g, '\\$1').replace(/\0/g, '\\0') + "'"
130+
: "'" + mixedExpression.replace(/([\\'])/g, '\\$1').replace(/\0/g, '\\0') + "'"
131131
}
132132

133133
if (!boolReturn) {

0 commit comments

Comments
 (0)