You are here

function Common::safeBasename in Filebrowser 3.x

Same name and namespace in other branches
  1. 8.2 src/Services/Common.php \Drupal\filebrowser\Services\Common::safeBasename()

UTF8 bullet-proof basename replacement.

Parameters

string $path:

Return value

string

File

src/Services/Common.php, line 242

Class

Common
Class Common @package Drupal\filebrowser\Services

Namespace

Drupal\filebrowser\Services

Code

function safeBasename($path) {
  $path = rtrim($path, '/');
  $path = explode('/', $path);
  return end($path);
}