From 09e221b2d884739ccfe5fb92396c7aba059452fe Mon Sep 17 00:00:00 2001 From: DHTMLGoodies Date: Wed, 28 Aug 2013 13:56:06 +0200 Subject: [PATCH] Parser fix --- PgnParser.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PgnParser.php b/PgnParser.php index 20d8909..b12b733 100644 --- a/PgnParser.php +++ b/PgnParser.php @@ -24,8 +24,12 @@ class PgnParser $extension = $this->getExtension($filePath); if($extension != 'pgn')return null; if(substr($filePath,0,1)==="/")return null; + $filePath = preg_replace("/[^0-9\.a-z_\-\/]/si", "", $filePath); + if(!file_exists($filePath))return null; - return preg_replace("/[^0-9\.a-z_\-\/]/si", "", $filePath); + + return $filePath; + } private function getExtension($filePath){