Download the PHP package yidas/magic-quotes-gpc without Composer
On this page you can find all versions of the php package yidas/magic-quotes-gpc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yidas/magic-quotes-gpc
More information about yidas/magic-quotes-gpc
Files in yidas/magic-quotes-gpc
Package magic-quotes-gpc
Short Description Implement magic_quotes_gpc on PHP 5.4 above version for legacy code
License MIT
Homepage https://github.com/yidas/php-magic-quotes-gpc
Informations about the package magic-quotes-gpc
PHP Magic Quotes Implementation
Implement magic_quotes_gpc on PHP 5.4 later version for legacy code
If you are migrating legacy source code to the enviorment with PHP version 5.4 above, but including lots of vulnerable DB query codes depending on Magic Quotes magic_quotes_gpc
SQL protection. Just use this to run smoothly on new version PHP like old time.
As PHP's Warning for Magic Quotes:
Magic Quotes feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
DEMONSTRATION
After visiting URL with query ?username=1' OR '1'='1
, and the output will be:
Array ( [username] => 1' OR '1'='1 )
Array ( [username] => 1\' OR \'1\'=\'1 )
Recursive Input Data Concern
The recursive data input from $_POST
, $_COOKIE
even $_GET
will be handled also:
After simulating $_POST
data assignment, the output will be:
Array ( [users] => Array ( [0] => Array ( [username] => 1' OR '1'='1 ) ) )
Array ( [users] => Array ( [0] => Array ( [username] => 1\' OR \'1\'=\'1 ) ) )
INSTALLATION
Install via Composer
Run Composer in your legacy project:
composer require yidas/magic-quotes
Then initialize it at the bootstrap of application such as config
file:
Install Directly by Loading Class
Load the MagicQuotesGpc.php
and initialize it: