Security policy: reject magic_quotes configuration if enabled. Cleanup QueryString.php of magic quotes.

Signed-off-by: Norv <a.w.norv@gmail.com>
Move utility functions _recursive() to Util class. They aren't currently used, but potentially useful...

Signed-off-by: Norv <a.w.norv@gmail.com>
htmlspecialchars() HTTP_USER_AGENT. (from Util.) This removes db entirely from QueryString.php..

Signed-off-by: Norv <a.w.norv@gmail.com>
Refactor $smcFunc['db_unescape_string'] -> $db->unescape_string() and remove it from $smcFunc.

Signed-off-by: Norv <a.w.norv@gmail.com>
Move cleanRequest() up in the execution chain. (before loading the db)

Signed-off-by: Norv <a.w.norv@gmail.com>
Remove a custom $_SERVER['is_cli'] var

Signed-off-by: Norv <a.w.norv@gmail.com>
Add Request class, for the request and its environment. It holds currently client/ban ips and user agent, will hold http scheme.
cleanRequest() uses it.

Signed-off-by: Norv <a.w.norv@gmail.com>
Remove $_SERVER['BAN_CHECK_IP'] -> ban_ip() method of Request

Signed-off-by: Norv <a.w.norv@gmail.com>
Remove the last trace of $_SERVER['BAN_CHECK_IP'] which was for compatibility

Signed-off-by: Norv <a.w.norv@gmail.com>
Add parseRequest(), the method is part of request cleaning and makes sure board, topic, and other necessary vars are ready to use.

Signed-off-by: Norv <a.w.norv@gmail.com>
Add server_software() to Request, to query for the webserver.

Signed-off-by: Norv <a.w.norv@gmail.com>
Refactor $_SERVER['HTTP_USER_AGENT'] to user_agent().

Signed-off-by: Norv <a.w.norv@gmail.com>
Add scheme, https or http

Signed-off-by: Norv <a.w.norv@gmail.com>
Add Request tests. These are the first *unit* tests, they test a self-contained
unit of behavior.
Well in the measure accepting superglobals directly and filling globals counts as self-contained. :P

Signed-off-by: Norv <a.w.norv@gmail.com>
Merge pull request #431 from norv/querystring.php

Querystring.php