Taint now flows through Stringable chains.
Fixes
- Keep the taint of a
Stringablethrough the methods whose result holds its string, such astrim(),upper(),after(),limit(),append()andtoString(). EachStringablekeeps its own taint, so a tainted call doesn't taint the same method on other strings.hash(),encrypt(),toBase64()andnumbers()drop the taint, andslug()andstripTags()remove HTML (#2374)
$name = $request->str('name');
echo $name->trim()->upper();
-// no issue
+// TaintedHtml
echo Str::of('safe')->upper();
// no issueFull Changelog: v4.23.0...v4.23.1