/** * Parses out a file name from the current path. * The last path component is returned if it contains an extension * of at least one character. * @param $path string: Path to parse. * @return string: File name */ private function parseFilename($path) { preg_match("#[^\\/]*\\.[a-z0-9]{1,}\$#i", $path, $matches); if (isset($matches[0])) { return api_helpers_string::ensureUtf8(urldecode($matches[0])); } return ''; }