Skip to content

Commit

Permalink
fix: $ in php string
Browse files Browse the repository at this point in the history
  • Loading branch information
l5oo00 authored Nov 15, 2019
1 parent 4876d56 commit fd252f4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/target-php/compilers/expr-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const compileExprSource = {
return '"' + source
.replace(/\x5C/g, '\\\\')
.replace(/"/g, '\\"')
.replace(/(\\)?\$/g, '\\$$') // php 变量解析 fix, 方案同 ts2php
.replace(/\n/g, '\\n')
.replace(/\t/g, '\\t')
.replace(/\r/g, '\\r') + '"'
Expand Down

0 comments on commit fd252f4

Please sign in to comment.