luźny temat z pytaniem co myślicie to tej małej klasie:
Jej zadaniem ma być sprawdzenie jeszcze w bootstrapie czy akcje zadań są wykonywane przez usera a nie bota itd.
/** * @author Spawnm * @license New BSD License */ class security_request { /** * @param array $data */ { if($_GET){ foreach($data as $key){ throw new Exception('initGET: security failed.'); } throw new Exception('initGET: security failed.'); } } } } /** * @return bool */ public function refererIsLocal() { $host = $host['host']; $local = $_SERVER['HTTP_HOST']; return ($host === $local )? true : false; } /** * @param array $data */ { if($_POST){ foreach($data as $key){ throw new Exception('initPOST: security failed.'); } throw new Exception('initPOST: security failed.'); } } } } }
Demo:
$sec= new security_request();