Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function __construct()
- {
- $dissalow_useragent = ['sqlmap','bot','curl'];
- if(preg_match("/".implode("|",$dissalow_useragent)."/",$_SERVER['HTTP_USER_AGENT']))
- {
- exit('Error.');
- }
- public function filter_xss($filter)
- {
- $str = addslashes(stripslashes(strip_tags(htmlspecialchars($filter))));
- return $str;
- }
- public function filter_sqli($id)
- {
- $tolak = ['union','select','group','concat','order by'];
- $p = str_replace(implode("|",$tolak),"",$id);
- $p = abs($id);
- return $p;
- }
- function filter_ua(){
- $useragent = array("sqlmap","curl","wget");
- $getuseragent = $_SERVER['HTTP_USER_AGENT'];
- if(preg_match("/".implode("|",$useragent)."/",$getuseragent)){
- header('HTTP/1.0 404 Not Found');
- exit;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment