note 111921 added to security
| From: | yan dot uniko dot 102 at gmail dot com | Date: | Thu, 11 Apr 2013 12:32:21 +0000 |
| Subject: | note 111921 added to security | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-194456@lists.php.net to get a copy of this message | ||
Check if file is included for prevent escape information:
<?php if($_SERVER['SCRIPT_FILENAME'] == __file__) exit;
/*Some Code */
?>
Check include file from GET Request:
<?php
if(isset($_GET['inc']) and in_array($inc =
dirname(__file__).'/inc/'.$_GET['inc'].'.php',
glob(dirname(__file__).'/inc/*.php'))){
include($inc);
unset($inc);
}else
include(dirname(__file__).'/inc/default.php');
?>
----
Server IP: 69.147.83.199
Probable Submitter: 200.1.174.4
----
Manual Page -- http://php.net/manual/en/security.php
Edit -- https://master.php.net/note/edit/111921
Del: integrated -- https://master.php.net/note/delete/111921/integrated
Del: useless -- https://master.php.net/note/delete/111921/useless
Del: bad code -- https://master.php.net/note/delete/111921/bad+code
Del: spam -- https://master.php.net/note/delete/111921/spam
Del: non-english -- https://master.php.net/note/delete/111921/non-english
Del: in docs -- https://master.php.net/note/delete/111921/in+docs
Del: other reasons-- https://master.php.net/note/delete/111921
Reject -- https://master.php.net/note/reject/111921
Search -- https://master.php.net/manage/user-notes.php