mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 23:24:57 +00:00
add addDirSep()
This commit is contained in:
parent
5543333291
commit
7520634c61
|
@ -565,9 +565,25 @@ function get_extension($mimetype) { /* {{{ */
|
||||||
case 'application/pdf': return '.pdf';
|
case 'application/pdf': return '.pdf';
|
||||||
case 'application/postscript': return '.ps';
|
case 'application/postscript': return '.ps';
|
||||||
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': return '.docx';
|
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': return '.docx';
|
||||||
|
case 'application/vnd.openxmlformats-officedocument.presentationml.presentation': return '.pptx';
|
||||||
case 'text/plain': return '.txt';
|
case 'text/plain': return '.txt';
|
||||||
case 'text/csv': return '.csv';
|
case 'text/csv': return '.csv';
|
||||||
default: return false;
|
default: return false;
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a missing front slash to a string
|
||||||
|
*
|
||||||
|
* This function is used for making sure a directory name has a
|
||||||
|
* trailing directory separator
|
||||||
|
*/
|
||||||
|
function addDirSep($str) { /* {{{ */
|
||||||
|
if(trim($str) == '')
|
||||||
|
return '';
|
||||||
|
if(substr(trim($str), -1, 1) != DIRECTORY_SEPARATOR)
|
||||||
|
return trim($str).DIRECTORY_SEPARATOR;
|
||||||
|
else
|
||||||
|
return trim($str);
|
||||||
|
} /* }}} */
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user