mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-29 00:54:31 +00:00
improves by songeriux + minor changes by me
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename Protection.php ##
|
||||
## Developed by: Songeriux ##
|
||||
#################################################################################
|
||||
|
||||
function filter($txt) {
|
||||
$arr_simboliu = array("#","$","!","\"","%","^","?","_","-","+","|","<",">","{","}","[","]",",","'");
|
||||
$arr_kodu = array("#","$","!",""","%","^","?","_","-","+","|","<",">","{","}","[","]",",","'");
|
||||
return strip_tags(mysql_real_escape_string(str_replace($arr_simboliu,$arr_kodu,htmlspecialchars(trim($txt)))));
|
||||
} // The script blocks out any dangorous simbols, and replaces them with an code. also protects mysql database.
|
||||
|
||||
|
||||
## We need to put it on every GET, POST, COOKIE, SESSION and SERVER methods.
|
||||
if(isset($_GET)){ foreach($_GET as $key=>$value) { $_GET[$key]=filter($value); } }
|
||||
if(isset($_POST)){ foreach($_POST as $key=>$value) { $_POST[$key]=filter($value); } }
|
||||
if(isset($_SESSION)){ foreach($_SESSION as $key=>$value){ $_SESSION[$key]=filter($value); } }
|
||||
if(isset($_COOKIE)){ foreach($_COOKIE as $key=>$value){ $_COOKIE[$key]=filter($value); } }
|
||||
if(isset($_SERVER)){ foreach($_SERVER as $key=>$value){ $_SERVER[$key]=filter($value); } }
|
||||
?>
|
||||
Reference in New Issue
Block a user