mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Additional XSS checks #1088
This commit is contained in:
parent
e03ccbd7a9
commit
19331e6746
2 changed files with 12 additions and 11 deletions
|
|
@ -67,7 +67,11 @@ class UploadFileFilter
|
|||
*/
|
||||
protected static function _checkSVG($fp, $from, $to)
|
||||
{
|
||||
if (self::_matchStream('/<script|xlink:href\s*=\s*"(?!data:)/i', $fp, $from, $to))
|
||||
if (self::_matchStream('/<script|<handler\b|xlink:href\s*=\s*"(?!data:)/i', $fp, $from, $to))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (self::_matchStream('/\b(?:ev:(?:event|listener|observer)|on[a-z]+)\s*=/i', $fp, $from, $to))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue