m (→User contributed notes: added example)
m (JoomlaWikiBot moved page JFile::makeSafe/11.1 to API17:JFile::makeSafe without leaving a redirect: Robot: Moved page)
Makes file name safe to use.
public static function makeSafe ($file)
|$file||string||The name of the file [not full path]|
//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']);