note 93347 deleted from function.include by googleguy

From: Date: Wed, 01 Aug 2012 06:59:15 +0000
Subject: note 93347 deleted from function.include by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-189554@lists.php.net to get a copy of this message
Note Submitter: rjw201 at cam dot ac dot uk ---- A even better security solution is to do the following: $path = basename($page, 'php') . '.php'; if(file_exists($path)) include $path; This will mean it will only load files with the ".php" extension in the current directory. Eg $page = 'myfile.php' => 'myfile.php' $page = '/etc/passwd' => 'passwd.php' => not found $page = 'myfile.jpg' => 'myfile.jpg.php' => not found Simple. Richard

« previous php.notes (#189554) next »