You are here

function _filebrowser_safe_dirname in Filebrowser 6.2

Same name and namespace in other branches
  1. 8 filebrowser.helpers.inc \_filebrowser_safe_dirname()
  2. 7.4 filebrowser.helpers.inc \_filebrowser_safe_dirname()
  3. 7.2 filebrowser.helpers.inc \_filebrowser_safe_dirname()
  4. 7.3 filebrowser.helpers.inc \_filebrowser_safe_dirname()

UTF8 bullet-proof dirname replacement.

4 calls to _filebrowser_safe_dirname()
filebrowser_filebrowser_metadata_set in ./filebrowser.module
filebrowser_page_download in includes/downloads.inc
Callback for filebrowser_download/%node menu.
_filebrowser_load_files in includes/filesystem.inc
Load data from current path.
_filebrowser_read_description in includes/metadata.inc

File

includes/filesystem.inc, line 326

Code

function _filebrowser_safe_dirname($path) {
  $path = rtrim($path, '/');
  $path = explode('/', $path);
  array_pop($path);
  $result = implode("/", $path);
  if ($result == '') {
    return '/';
  }
  return $result;
}