{"id":18920047,"url":"https://github.com/gongo/merciful-polluter","last_synced_at":"2025-06-12T06:10:35.417Z","repository":{"id":25092694,"uuid":"28513640","full_name":"gongo/merciful-polluter","owner":"gongo","description":"Emulate \"register_globals\" and \"magic_quotes_gpc\"","archived":false,"fork":false,"pushed_at":"2024-05-14T14:41:34.000Z","size":52,"stargazers_count":17,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-16T09:49:11.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/gongo/merciful-polluter","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"webpack-contrib/css-loader","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gongo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-26T15:07:32.000Z","updated_at":"2024-08-18T15:08:50.000Z","dependencies_parsed_at":"2022-08-06T03:01:21.366Z","dependency_job_id":"a5f7aa2e-7a06-4513-ad9b-eb654ff01ccf","html_url":"https://github.com/gongo/merciful-polluter","commit_stats":{"total_commits":43,"total_committers":5,"mean_commits":8.6,"dds":"0.37209302325581395","last_synced_commit":"7922f380619aa2d65aeb7d5951e861bce5aba5c2"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/gongo/merciful-polluter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gongo%2Fmerciful-polluter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gongo%2Fmerciful-polluter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gongo%2Fmerciful-polluter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gongo%2Fmerciful-polluter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gongo","download_url":"https://codeload.github.com/gongo/merciful-polluter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gongo%2Fmerciful-polluter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259410149,"owners_count":22852970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T10:42:14.403Z","updated_at":"2025-06-12T06:10:35.374Z","avatar_url":"https://github.com/gongo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"MercifulPolluter\n====================\n\nTo relieve [register_globals](http://php.net/register_globals) and [magic_quotes_gpc](http://php.net/magic_quotes_gpc) refugees.\n\n![CI status](https://github.com/gongo/merciful-polluter/actions/workflows/ci.yml/badge.svg?branch=master)\n[![Coverage Status](https://coveralls.io/repos/gongo/merciful-polluter/badge.png?branch=master)](https://coveralls.io/r/gongo/merciful-polluter?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/gongo/merciful-polluter/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/gongo/merciful-polluter/?branch=master)\n\nDescription\n--------------------\n\nIn PHP 5.4, violent directives (`register_globals` and `magic_quotes_gpc`) has been removed.\nBut there are systems that may still depend on them.\n\nThis library reproduce these features in PHP 5.4 and later. **Salvation**\n\nUsage\n--------------------\n\n```php\n\u003c?php\n/**\n * example.com/?foo=3\u0026bar=12\n */\n\n(new Gongo\\MercifulPolluter\\Request)-\u003epollute();\n\nglobal $foo, $bar;\nvar_dump($foo, $bar);\n\n/**\n * int(3)\n * int(12)\n */\n```\n\nInstallation\n--------------------\n\nAdd this lines to your application's `composer.json`:\n\n```json\n{\n    \"require\": {\n        \"gongo/merciful-polluter\": \"*\"\n    }\n}\n```\n\nAnd then execute:\n\n```sh\n$ composer install\n```\n\nOr install it yourself as:\n\n```sh\n$ composer require gongo/merciful-polluter\n```\n\nSee also: https://packagist.org/packages/gongo/merciful-polluter\n\nFeatures\n--------------------\n\n### Emulate `register_globals`\n\nAdd this lines to your application's entry point (like in `auto_prepend_file`):\n\n```php\n\u003c?php\n$request = new Gongo\\MercifulPolluter\\Request;\n$request-\u003epollute();\n\n// main routine...\n```\n\nIf use the session, call `Gongo\\MercifulPolluter\\Session::pollute()` **after** `session_start()`:\n\n```php\nsession_start();\n\n/**\n * $_SESSION['user_id'] = 'gongo'\n */\n\n(new Gongo\\MercifulPolluter\\Session)-\u003epollute();\n\nvar_dump($user_id); // string(5) \"gongo\"\n\n// Reference global variables to session.\n$user_id = 'taro';\nvar_dump($_SESSION['user_id']); // string(4) \"taro\"\n```\n\n### Emulate `magic_quotes_gpc`\n\nIf want to apply `magic_quotes_gpc`, call `Gongo\\MercifulPolluter\\Request::enableMagicQuotesGpc()`:\n\n```php\n\u003c?php\n/**\n * example.com/?foo=1'2'3\n */\n\n$request = new Gongo\\MercifulPolluter\\Request;\n$request-\u003eenableMagicQuotesGpc();\n$request-\u003epollute();\n\n// $_GET['foo'] =\u003e \"1\\'2\\'3\"\n//        $foo  =\u003e \"1\\'2\\'3\"\n```\n\nLicense\n--------------------\n\nMIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgongo%2Fmerciful-polluter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgongo%2Fmerciful-polluter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgongo%2Fmerciful-polluter/lists"}