1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| private function setName($Name){
$chars = array('/\./', '/\*/', '/\?/', '/&/','/"/', '/#/', '/~/', '/{/', '/\(/', '/\[/', '/\|/', '/`/', '/_/', '/\^/', '/\)/', '/\]/', '/=/', '/\+/', '/}/', '/%/', '/;/', '/\//', '/!/', '/§/', '/</', '/>/');
$max = count($chars);
$check = true;
for ($i=0;$i<$max;$i++) {
if (preg_match($chars[$i],$Name)) {
$check = false;
}
}
if($check){
$this->_fileName = $Name;
return $this;
}
self::setError("Invalid file name characters");
return false;
} |
Partager