enygma/shieldframework — pull request #9 by GR3S (2012-07-31 15:02:28+00:00)
Title: Fixed checking magic quotes and simplified checking register globals

1. In PHP empty string, string "0", zero number and null in non-strict comparison are converted to false:
http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting
http://php.net/manual/en/language.operators.comparison.php
`$reg = ini_get('register_globals');if ($reg != '' && $reg !== false && $reg !== 0) {}` is equals to `if (ini_get('register_globals')) {}`, but second looks better.

2. `magic_quotes` directive does not exist.
```ini
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off
; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off
```

For checking magic quotes you can use [get_magic_quotes_gpc](http://www.php.net/manual/en/function.get-magic-quotes-gpc.php) || [get_magic_quotes_runtime](http://www.php.net/manual/en/function.get-magic-quotes-runtime.php) or ini_get('magic_quotes_gpc') || ini_get('magic_quotes_runtime')