{"id":19458822,"url":"https://github.com/leafsphp/anchor","last_synced_at":"2025-07-31T17:08:04.576Z","repository":{"id":45174388,"uuid":"408098546","full_name":"leafsphp/anchor","owner":"leafsphp","description":"🔐 Leaf PHP security module","archived":false,"fork":false,"pushed_at":"2024-10-10T17:09:50.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-18T10:24:58.313Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://leafphp.dev/modules/anchor/","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/leafsphp.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"leaf","github":"leafsphp"}},"created_at":"2021-09-19T10:39:26.000Z","updated_at":"2024-10-10T13:55:28.000Z","dependencies_parsed_at":"2022-09-05T20:00:46.931Z","dependency_job_id":"6a8d9695-75d9-4b00-8ce6-db9a6345d692","html_url":"https://github.com/leafsphp/anchor","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"debc228afd63d46d94d0c1d02629c2d912ecb4ee"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/leafsphp/anchor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fanchor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fanchor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fanchor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fanchor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leafsphp","download_url":"https://codeload.github.com/leafsphp/anchor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fanchor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261092966,"owners_count":23108568,"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-10T17:28:40.059Z","updated_at":"2025-06-21T08:33:41.005Z","avatar_url":"https://github.com/leafsphp.png","language":"PHP","readme":"\u003c!-- markdownlint-disable no-inline-html --\u003e\n\u003cp align=\"center\"\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cimg src=\"https://leafphp.dev/logo-circle.png\" height=\"100\"/\u003e\n  \u003cbr\u003e\u003cbr\u003e\n\u003c/p\u003e\n\n# Leaf Anchor\n\n[![Latest Stable Version](https://poser.pugx.org/leafs/anchor/v/stable)](https://packagist.org/packages/leafs/anchor)\n[![Total Downloads](https://poser.pugx.org/leafs/anchor/downloads)](https://packagist.org/packages/leafs/anchor)\n[![License](https://poser.pugx.org/leafs/anchor/license)](https://packagist.org/packages/leafs/anchor)\n\nThis package contains leaf's utils for deep sanitizing of data and basic security provided for your app data. It also serves as the base for security provided in other modules like CSRF.\n\n## Installation\n\nYou can easily install Leaf using [Composer](https://getcomposer.org/).\n\n```bash\ncomposer require leafs/anchor\n```\n\n## Basic Usage\n\nAfter [installing](#installation) anchor, create an _index.php_ file.\n\n### Base XSS protection\n\n```php\n\u003c?php\nrequire __DIR__ . \"vendor/autoload.php\";\n\n$data = $_POST[\"data\"];\n$data = Leaf\\Anchor::sanitize($data);\n\necho $data;\n```\n\nThis also works on arrays\n\n```php\n\u003c?php\nrequire __DIR__ . \"vendor/autoload.php\";\n\n$data = Leaf\\Anchor::sanitize($_POST);\n\necho $data[\"input\"];\n```\n\nYou may quickly test this using the built-in PHP server:\n\n```bash\nphp -S localhost:8000\n```\n","funding_links":["https://opencollective.com/leaf","https://github.com/sponsors/leafsphp"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafsphp%2Fanchor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleafsphp%2Fanchor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafsphp%2Fanchor/lists"}