slugify
slugify copied to clipboard
Dirty string with ampersands
How about a bit more dirty string with ampersands after htmlspecialchars()
?
$str = '*** ____ "Hello world" Anything ___ *** - something';
The above gives us quot-hello-world-quot-anything-something
. Shouldn't the slugify
cut everything between &
and ;
?
No, it should not. The purpose of this library is to replace special characters with -
, not clean up strings. Why are you running htmlspecialchars() before passing the string to slugify
?