Skip to content

Commit

Permalink
fix: attribute escape
Browse files Browse the repository at this point in the history
  • Loading branch information
harttle committed Jan 27, 2021
1 parent d021bce commit 8f4124f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"jest": "^26.2.2",
"san-html-cases": "^3.10.5",
"san-ssr": "^4.4.0",
"san-html-cases": "^3.10.8",
"san-ssr": "^4.4.1",
"semantic-release": "^17.1.1",
"typedoc": "^0.17.8",
"wdio-sauce-service": "^0.4.14",
Expand All @@ -94,7 +94,7 @@
"yargs": "^15.4.1"
},
"peerDependencies": {
"san-ssr": "^4.4.0"
"san-ssr": "^4.4.1"
},
"release": {
"branch": "master",
Expand Down
6 changes: 6 additions & 0 deletions runtime/underscore.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ public static function toString($source) {
return strval($source);
}

public static function escapeHTML($source)
{
if (!is_string($source)) return $source;
return htmlspecialchars($source, ENT_QUOTES);
}

public static function output($source, $needEscape)
{
if (!isset($source)) return "";
Expand Down

0 comments on commit 8f4124f

Please sign in to comment.