-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
Symfony version(s) affected
6.4 and newer
Description
Hello,
I find this code is too invasive:
html-sanitizer/TextSanitizer
/UrlSanitizer.php
if (preg_match('/\s/', $url)) {
return null;
}
What is the purpose of this, to avoid spaces before and after the string? like
" http://www.some.com/assets/test1.jpg" or " http://www.some.com/assets/test1.jpg "
This code will also remove something like "http://www.some.com/assets/test 1.jpg" if there are spaces in the asset name or pathname. I think whitespace should be allowed there.
Thanks
How to reproduce
for example URLs containig whitespace in the asset name
Possible Solution
Treat the URL as invalid if there are spaces at the beginning or end of the URL could be eine
Additional Context
No response