You are here

function Common::safeBasename in Filebrowser 8.2

Same name and namespace in other branches
  1. 3.x 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);
}