Skip to content

Commit 3dd0cab

Browse files
committed
Fixed entity sanitization for XSS detection
1 parent b992d7f commit 3dd0cab

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Fixed `'mbstring' extension is not loaded` error, use Polyfill instead [#3504](https://github.com/getgrav/grav/pull/3504)
99
* Fixed new `Utils::pathinfo()` and `Utils::basename()` being too strict for legacy use [#3542](https://github.com/getgrav/grav/issues/3542)
1010
* Fixed non-standard video html atributes generated by `{{ media.html() }}` [#3540](https://github.com/getgrav/grav/issues/3540)
11+
* Fixed entity sanitization for XSS detection
1112

1213
# v1.7.30
1314
## 02/07/2022

system/src/Grav/Common/Security.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public static function detectXss($string, array $options = null): ?string
200200
}, $string);
201201

202202
// Clean up entities
203-
$string = preg_replace('!(&#0+[0-9]+)!u', '$1;', $string);
203+
$string = preg_replace('!(&#[0-9]+)!u', '$1;', $string);
204204

205205
// Decode entities
206206
$string = html_entity_decode($string, ENT_NOQUOTES | ENT_HTML5, 'UTF-8');

0 commit comments

Comments
 (0)