src/GuillermoMartinez/Filemanager/Filemanager.php
public function validNameFile($filename,$ext=true){
        $filename = trim($filename);
        if($filename!="." && $filename!=".." && $filename!=" " && preg_match_all("#^[a-zA-Z0-9-_.\s]+$#",$filename) > 0){
            if($ext) return $this->validExt($filename);
            else return true;
        }else{
            return false;
        }
    }
public function validNameFile($filename,$ext=true){
        $filename = trim($filename);
        if($filename!="." && $filename!=".." && $filename!=" " && preg_match_all("#^[a-zA-Z0-9-_.\s]+$#",$filename) > 0){
            if($ext) return $this->validExt($filename);
            else return true;
        }else{
            return false;
        }
    }
public function validNameFile ( $ filename , $ ext = true ) { $ filename = trim ( $ filename ) ; if ( $ filename != "." && $ filename != ".." && $ filename != " " && preg_match_all ( "#^[a-zA-Z0-9-_.\s]+$#" , $ filename ) > 0 ) { if ( $ ext ) return $ this -> validExt ( $ filename ) ; else return true ; } else { return false ; } }
Valida nombre de archivo
@param string $filename
@return boolean
Valida nombre de archivo