From Joomla! Documentation
Revision as of 22:01, 24 March 2017 by JoomlaWikiBot (preparing for archive only)
The "API17" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Makes file name safe to use.
public static function makeSafe ($file)
|$file||string||The name of the file [not full path]|
- Returns string The sanitised string
- Defined on line 60 of libraries/joomla/filesystem/file.php
- JFile::makeSafe source code on BitBucket
- Class JFile
- Subpackage Filesystem
- Other versions of JFile::makeSafe
User contributed notes
//Retrieve file details from uploaded file, sent from upload form $file = JRequest::getVar('upload_file', null, 'files', 'array'); //Import filesystem libraries. Perhaps not necessary, but does not hurt jimport('joomla.filesystem.file'); //Clean up filename to get rid of strange characters like spaces etc $filename = JFile::makeSafe($file['name']);