You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
slugify: letters without decomposition removed by default, strip_tags() truncating at a '<', no multibyte lowercase, TypeError on non-string inputs #400
Letters without decomposition are removed: the default transliterator (NFD; [:Nonspacing Mark:] Remove; NFC) only removes the accents. The letters that are not decomposed are then removed by the default replace pattern: "Cœur" gives c_ur, "Straße" stra_e, "Łódź" odz, and a text without latin letters gives "". The documentation does not say so.
strip_tags() truncates any text containing a <: "Tom<Jerry" gives tom, "<3 love" gives "". It cannot be disabled.
Lowercasing is not multibyte: strtolower() leaves the non-ASCII uppercase letters kept by a custom transliterator / replace pattern.
Inputs other than a string: null, an int or a float throw a raw TypeError (Transliterator::transliterate() with strict types).
Fix: document the default transliterator and recommend Any-Latin; Latin-ASCII; new strip_tags option (true by default); mb_strtolower(); cast the scalars and \Stringable to string, explicit UnexpectedValueException for the other values. Changing the defaults (transliterator, strip_tags) is left to v6.0.
Found during the audit v3 (audit-v3-angles.md#193, #194, and #202 for slugify).
Activity
Merge pull request #401 from cleverage/400