Skip to content

Commit

Permalink
Fix JavaScript Unicode escape sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
thisispiers committed Jul 21, 2023
1 parent 2f01bda commit aaa8272
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Escape.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function encode(
if ($format === 'html') {
$encoded_data .= '&#x' . $hex . ';';
} else if ($format === 'unicode') {
$encoded_data .= '\\u' . $ord;
$encoded_data .= '\\u{' . $hex . '}';
} else if ($format === 'css') {
$hex = str_pad($hex, 6, '0', \STR_PAD_LEFT);
$encoded_data .= '\\' . $hex;
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "thisispiers/xss-escape",
"description": "A PHP implementation of OWASP Cross Site Scripting Prevention Cheat Sheet",
"license": "LGPL-3.0-only",
"version": "1.0.1",
"require": {
"php": ">=7.1",
"ext-mbstring": "*"
Expand Down

0 comments on commit aaa8272

Please sign in to comment.