function _filebrowser_safe_dirname in Filebrowser 8
Same name and namespace in other branches
- 6.2 includes/filesystem.inc \_filebrowser_safe_dirname()
- 7.4 filebrowser.helpers.inc \_filebrowser_safe_dirname()
- 7.2 filebrowser.helpers.inc \_filebrowser_safe_dirname()
- 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 ./
filebrowser.pages.inc - Callback for filebrowser_download/%node menu.
- _filebrowser_load_files in ./
filebrowser.common.inc - Load data from current path.
- _filebrowser_read_description in ./
filebrowser.common.inc
File
- ./
filebrowser.helpers.inc, line 57 - Misc helper functions.
Code
function _filebrowser_safe_dirname($path) {
$path = rtrim($path, '/');
$path = explode('/', $path);
array_pop($path);
$result = implode("/", $path);
if ($result == '') {
return '/';
}
return $result;
}