php5 compatibility

This commit is contained in:
Raffael Sahli 2018-09-21 14:47:42 +02:00
commit 9a6fbed231

View file

@ -115,10 +115,11 @@ class NativeShare extends AbstractShare {
/** /**
* Multibyte unicode safe version of basename() * Multibyte unicode safe version of basename()
* *
* @param string $path
* @link http://php.net/manual/en/function.basename.php#121405 * @link http://php.net/manual/en/function.basename.php#121405
* @return string
*/ */
protected static function mb_basename($path): string protected static function mb_basename($path) {
{
if (preg_match('@^.*[\\\\/]([^\\\\/]+)$@s', $path, $matches)) { if (preg_match('@^.*[\\\\/]([^\\\\/]+)$@s', $path, $matches)) {
return $matches[1]; return $matches[1];
} elseif (preg_match('@^([^\\\\/]+)$@s', $path, $matches)) { } elseif (preg_match('@^([^\\\\/]+)$@s', $path, $matches)) {