{"id":22136971,"url":"https://github.com/maniruzzamanakash/sanitizer","last_synced_at":"2025-06-25T05:34:17.906Z","repository":{"id":46220204,"uuid":"425060728","full_name":"ManiruzzamanAkash/sanitizer","owner":"ManiruzzamanAkash","description":"Sanitize and escape every values in your PHP Application","archived":false,"fork":false,"pushed_at":"2022-11-16T03:49:38.000Z","size":35,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-21T21:43:29.802Z","etag":null,"topics":["escaping","php","php-sanitizer","sanitize-html","sanitizer"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/maniruzzaman/sanitizer","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ManiruzzamanAkash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null},"funding":{"patreon":"maniruzzaman"}},"created_at":"2021-11-05T19:20:35.000Z","updated_at":"2023-09-28T11:33:00.000Z","dependencies_parsed_at":"2023-01-21T19:05:20.850Z","dependency_job_id":null,"html_url":"https://github.com/ManiruzzamanAkash/sanitizer","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManiruzzamanAkash%2Fsanitizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManiruzzamanAkash%2Fsanitizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManiruzzamanAkash%2Fsanitizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManiruzzamanAkash%2Fsanitizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ManiruzzamanAkash","download_url":"https://codeload.github.com/ManiruzzamanAkash/sanitizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227618155,"owners_count":17794547,"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":["escaping","php","php-sanitizer","sanitize-html","sanitizer"],"created_at":"2024-12-01T19:29:40.276Z","updated_at":"2024-12-01T19:29:40.990Z","avatar_url":"https://github.com/ManiruzzamanAkash.png","language":"PHP","funding_links":["https://patreon.com/maniruzzaman","https://www.patreon.com/maniruzzaman"],"categories":[],"sub_categories":[],"readme":"# PHP Sanitizer\n\nSanitize and escape every values in your PHP Application.\n\n---\n\n\nThis solution will make PHP developer life easy, very easy and developers would be able to create a secure application quickly and effortlessly.\n\nLet's see inside of this.\n\n\n## Requirement\n- **PHP:** 7.1 or later\n- **PHP Unit (in dev):** 7\n\n\n## Latest Version\n`0.0.7`\n\n\n## How to install\n\n```shell\ncomposer require maniruzzaman/sanitizer\n```\n\n## Documentation\n\nInstantiation and loading.\n```php\n// at top of the class autoload\nuse Maniruzzaman\\Sanitizer\\Sanitize;\n\n// instantiate anywhere if needed\n$sanitize = new Sanitize();\n```\n\n#### Sanitize Text\n\n**Example 1: Sanitize text with script:**\n```php\n$string  = 'Text with script \u003cscript\u003ealert(\"you are hacked...\")\u003c/script\u003e';\nSanitize::text($string);\n#Output: Text with issuealert(\u0026quot;you are hacked...\u0026quot;)\n```\n\n\n**Example 2: Sanitize text with html texts:**\n```php\n$string  = 'Text with script \u003cstrong\u003eThis is strong text\u003c/strong\u003e';\nSanitize::text($string);\n#Output: Text with script This is strong text\n```\n\n#### Sanitize Attribute\n\n**Example 3: Sanitize attribute to filter out unnecessary strings:**\n```php\n$string  = 'https://devsenv.com\u003cscript\u003ewelcome\u003c/script\u003e';\n\n$sanitize = new Sanitize();\n$sanitize-\u003eattr($string);\n#Output: https:://devsenv.com\n```\n\n#### More is coming...\n\n## Testing\n\nWe've used [PHPUnit](https://phpunit.readthedocs.io/en/9.5/index.html)\n to test our codes.\n\nCheck if everything passes test cases or not. You can check our test cases to see the\nimplementations of Sanitizer.\n\n```php\n// For full directory\nphpunit tests\n\n// For specific file test\nphpunit tests/SanitizeTest.php\n```\n\n\n## Release Notes:\n\n#### Release version `0.0.7`\n- [Enhancement] Added unit test for text() helper sanitize function.\n- [Enhancement] Added some security and fund links\n\n#### Release version `0.0.6`\n- [Enhancement] Updated some doc-block\n- [Enhancement] Structured some code base\n- [Enhancement] Updated Minimum PHP Version requirement\n- [Enhancement] Added PHP Unit test support dev package\n\n#### Release version `0.0.5`\n- Fixed some autoloading issue with documenting\n\n#### Release version `0.0.4`\n- Fixed autoloading functions\n\n#### Release version `0.0.3`\n- Removed some unused autoload dependency\n\n#### Release version `0.0.2`\n- Added `Url` Sanitization\n\n\n#### Release version `0.0.1`\n- Release some simple escaping functions.\n- Added `text` sanitization\n- Added `attribute` sanitization\n\n## License\nThe Library is open-sourced software licensed under the \u003ca href=\"https://opensource.org/licenses/MIT\"\u003eMIT license\u003c/a\u003e.\n\n## Support\nDo you wanna support me to buy a coffee? Please be one of my patreon -\nhttps://www.patreon.com/maniruzzaman\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaniruzzamanakash%2Fsanitizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaniruzzamanakash%2Fsanitizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaniruzzamanakash%2Fsanitizer/lists"}