Parser fix
This commit is contained in:
@@ -24,8 +24,12 @@ class PgnParser
|
|||||||
$extension = $this->getExtension($filePath);
|
$extension = $this->getExtension($filePath);
|
||||||
if($extension != 'pgn')return null;
|
if($extension != 'pgn')return null;
|
||||||
if(substr($filePath,0,1)==="/")return null;
|
if(substr($filePath,0,1)==="/")return null;
|
||||||
|
$filePath = preg_replace("/[^0-9\.a-z_\-\/]/si", "", $filePath);
|
||||||
|
|
||||||
if(!file_exists($filePath))return null;
|
if(!file_exists($filePath))return null;
|
||||||
return preg_replace("/[^0-9\.a-z_\-\/]/si", "", $filePath);
|
|
||||||
|
return $filePath;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getExtension($filePath){
|
private function getExtension($filePath){
|
||||||
|
Reference in New Issue
Block a user