svg: secure input
This commit is contained in:
parent
ec966f558c
commit
a16d8d29dc
2 changed files with 2 additions and 0 deletions
|
|
@ -59,6 +59,7 @@ class Svg extends Widget {
|
|||
|
||||
var svg = this.getProp('svg')
|
||||
|
||||
svg = svg.replace(/<\/svg>/gi, 'x')
|
||||
svg = svg.replace(/([0-9\.]+%)[\s\n]*,/g, m => (parseFloat(m) * this.width / 100).toFixed(2) + ',')
|
||||
svg = svg.replace(/,[\s\n]*([0-9\.]+%)/g, m => ',' + (parseFloat(m.slice(1)) * this.height / 100).toFixed(2))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue