note 59523 added to function.highlight-file

From: Date: Fri, 09 Dec 2005 03:46:57 +0000
Subject: note 59523 added to function.highlight-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-99788@lists.php.net to get a copy of this message
this function can be a high security risk. use something like in_array to check if a file is prohibited to be shown on screen. <? $ar= array('config.php', 'index.php', 'functions.php'); //array with files to denie $file = $_GET[file]; // iniziate the variable if(file_Exists($file)){ if(!in_array($file, $ar)){ // check if it is prohibited highlight_file($file); //highlight file }else{ // prohibited file echo "You do not have permision to see the ".$file." file."; } }else{ // file doesnt exist echo "That file does not exist."; } ?> ---- Manual Page -- http://www.php.net/manual/en/function.highlight-file.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+59523 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59523&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59523&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59523&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59523&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59523&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59523&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59523&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+59523&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#99788) next »