added preg_match to check that file is indeed a file ending in .js

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@419 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-07-28 16:41:40 +00:00
parent 6fd89c96d5
commit 7c1d40c4f4

View file

@ -29,7 +29,7 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
if(is_file('../../vendors/javascript/'.$_GET['file']))
if(is_file('../../vendors/javascript/'.$_GET['file']) && (preg_match('/(.+)\\.js/', $_GET['file'])))
{
readfile('../../vendors/javascript/'.$_GET['file']);
}