{"id":28553897,"url":"https://github.com/siriusphp/filtration","last_synced_at":"2026-03-13T12:32:01.768Z","repository":{"id":10249706,"uuid":"12356588","full_name":"siriusphp/filtration","owner":"siriusphp","description":"Array filtering/sanitization","archived":false,"fork":false,"pushed_at":"2020-02-24T07:09:00.000Z","size":111,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-18T14:36:40.088Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siriusphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-25T09:01:57.000Z","updated_at":"2020-02-24T07:09:02.000Z","dependencies_parsed_at":"2022-08-27T04:00:19.253Z","dependency_job_id":null,"html_url":"https://github.com/siriusphp/filtration","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/siriusphp/filtration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siriusphp%2Ffiltration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siriusphp%2Ffiltration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siriusphp%2Ffiltration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siriusphp%2Ffiltration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siriusphp","download_url":"https://codeload.github.com/siriusphp/filtration/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siriusphp%2Ffiltration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30467370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T11:00:43.441Z","status":"ssl_error","status_checked_at":"2026-03-13T11:00:23.173Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-06-10T04:33:51.680Z","updated_at":"2026-03-13T12:32:01.752Z","avatar_url":"https://github.com/siriusphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Sirius\\Filtration\n\n[![Source Code](http://img.shields.io/badge/source-siriusphp/filtration-blue.svg?style=flat-square)](https://github.com/siriusphp/filtration)\n[![Latest Version](https://img.shields.io/packagist/v/siriusphp/filtration.svg?style=flat-square)](https://github.com/siriusphp/filtration/releases)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/siriusphp/filtration/blob/master/LICENSE)\n[![Build Status](https://img.shields.io/travis/siriusphp/filtration/master.svg?style=flat-square)](https://travis-ci.org/siriusphp/filtration)\n[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/siriusphp/filtration.svg?style=flat-square)](https://scrutinizer-ci.com/g/siriusphp/filtration/code-structure)\n[![Quality Score](https://img.shields.io/scrutinizer/g/siriusphp/filtration.svg?style=flat-square)](https://scrutinizer-ci.com/g/siriusphp/filtration)\n\nPHP library for array filtering/sanitization\n\nSometimes you want to make sure the values pushed by a source (eg: a user when submits a form) follow some restrictions like\n\n- no space at the beginning or the end for the title of a page\n- no HTML code in a comment sent by a user\n- no spaces in the field which represents the URL\n- remove XSS attacks\n- etc...\n\nOther times you want to make sure that the data you send to the user is parsed before displaying. For example you may want to:\n\n- convert markdown into HTML\n- convert URLs into links\n- apply a localized format to dates\n- etc ()\n\nTo achieve this end result you need to filter the values. This is where SiriusFiltration comes into place\n\n## Elevator pitch\n\n```php\nuse Sirius\\Filtration\\Filtrator;\n\n$filtrator = new Filtrator();\n\n// add filters for title\n$filtrator-\u003eadd('title', 'trim');\n$filtrator-\u003eadd('title', 'strip_tags');\n$filtrator-\u003eadd('title', 'nullify');\n\n// add filters for content in one go\n$filtrator-\u003eadd('content', [\n\t'trim'\n]);\n\n$result = $filtrator-\u003efilter(array(\n\t'title' =\u003e '   \u003ch1\u003eMy title has tags and is awesome\u003c/h1\u003e',\n\t'content' =\u003e '   My content was trimmed'\n));\n\n/* $result is\narray(\n\t'title' =\u003e NULL ,\n\t'content' =\u003e 'My content was trimmed'\n)\n*/\n```\n\n\n## Links\n\n- [documentation](http://www.sirius.ro/php/sirius/validation/)\n- [changelog](CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiriusphp%2Ffiltration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiriusphp%2Ffiltration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiriusphp%2Ffiltration/lists"}