From 44a4fdf5894f35cdc44edfcf9a18b4846895e14c Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 4 May 2010 23:26:25 +0000 Subject: [PATCH] class_extension : verify that the file does exist --- include/class_extension.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/class_extension.php b/include/class_extension.php index b2e224740..7bf1235aa 100644 --- a/include/class_extension.php +++ b/include/class_extension.php @@ -74,7 +74,9 @@ class Extension // Verify that the elt we want to add is correct if (trim($this->ex_code)=="") throw new Exception('Le code ne peut pas être vide'); if (trim($this->ex_name)=="") throw new Exception('Le nom ne peut pas être vide'); - + if (trim($this->ex_file)=="") throw new Exception('Chemin incorrect'); + if (file_exists('..'.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'ext'.DIRECTORY_SEPARATOR.$this->ex_file) == false) + throw new Exception ('Extension non trouvée, le chemin est-il correct?'); } /*!\brief call insert for a new plugin or update if the plugin exist */ public function save() {