dav
dav copied to clipboard
Purge "basename" from everything
basename() is not multibyte-safe and seems to have been removed from almost everywhere, but it still lingers in \sabre\dav\bin\migrateto30.php and is lurking in a comment in \sabre\dav\lib\DAV\Browser\Plugin.php
Also, it is used in the docs, for example in https://sabre.io/dav/virtual-filesystems/ which in this case bit me -- I had no idea basename was even a native PHP function, and its undefined utf8 behavior if not prepended with set_locale, and so it dropped the first mb char of every file name if present, which was unexpected. Easily fixed with Uri\split but that should be used everywhere for clarity I think.
Feel free to provide a PR which suggests an alternative