{"id":19510111,"url":"https://github.com/jakubboucek/legacy-escape","last_synced_at":"2026-06-13T08:32:42.882Z","repository":{"id":41961949,"uuid":"357657303","full_name":"jakubboucek/legacy-escape","owner":"jakubboucek","description":"Right escape data inserted to HTML, CSS, JS and URL in your legacy project.","archived":false,"fork":false,"pushed_at":"2025-04-22T06:16:50.000Z","size":49,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-22T07:04:06.584Z","etag":null,"topics":["legacy-application","php","security"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/jakubboucek/legacy-escape","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/jakubboucek.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-13T18:49:20.000Z","updated_at":"2024-10-17T07:13:08.000Z","dependencies_parsed_at":"2024-03-13T16:27:52.191Z","dependency_job_id":"cb9155e2-46e9-4405-bcc4-58a518c3f796","html_url":"https://github.com/jakubboucek/legacy-escape","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"12af16952b1dd6ddeca408b8bedfca67a7e4a78c"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/jakubboucek/legacy-escape","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubboucek%2Flegacy-escape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubboucek%2Flegacy-escape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubboucek%2Flegacy-escape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubboucek%2Flegacy-escape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakubboucek","download_url":"https://codeload.github.com/jakubboucek/legacy-escape/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubboucek%2Flegacy-escape/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34278153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["legacy-application","php","security"],"created_at":"2024-11-10T23:14:33.536Z","updated_at":"2026-06-13T08:32:42.863Z","avatar_url":"https://github.com/jakubboucek.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Escape\n\nPHP library to right escape outputs in your legacy project.\n\nDon't use package for new projects, use [Latte](https://latte.nette.org/) instead.\n\nPackage is substrate of [Latte package](https://github.com/nette/latte/)\n[filters](https://github.com/nette/latte/blob/master/src/Latte/Runtime/Filters.php).\n\n## Features\n\n- Escape HTML\n- Escape HTML attributes\n- Escape HTML href attributes\n- Escape HTML comments\n- Escape XML\n- Escape JS\n- Escape URL\n- Escape CSS\n- Escape CSS specifics for few properties: \n    - `color` value\n\n## Install\n\n```shell\ncomposer require jakubboucek/legacy-escape\n```\n\n## Usage\n\nInstead:\n```php\necho 'Registered user: ' . $username;\n```\n\nUse:\n```php\nuse JakubBoucek\\Escape\\Escape;\n\necho 'Registered user: ' . Escape::html($username);\n```\n\nYou can use shortcut by aliasing too:\n```php\nuse JakubBoucek\\Escape\\Escape as E;\n\necho 'Registered user: ' . E::html($username);\n```\n\n## CSS specifics\n\nIn few cases you cannot use `Escape::css($cssColor)` to escape\nsome known format, because standard escaping is broke CSS format. Class `EscapeCss` has prepared\nlimited set of known propetries with specefics format:\n\n### `color` property\n\nSanitize value od CSS `color` property to safe format, example:\n\n```php\nuse JakubBoucek\\Escape\\EscapeCss;\n\necho '\u003cstyle\u003ecolor: ' . EscapeCss::color($cssColor) . ';\u003c/style\u003e';\n```\n\nIt's prevent attact by escaping color value context.\n\n## Safe HTML content\n\nPackage supports escaping HTML with included [safe HTML content](https://doc.nette.org/en/3.1/html-elements).\n\nUsage:\n```php\nuse JakubBoucek\\Escape\\Escape;\nuse Nette\\Utils\\Html; \n\n$avatarUrl = 'http:/example.com/avatar.png';\n$username = 'John Doe \u003cscript\u003ehack\u003c/script\u003e';\n\n$avatarImage = Html::el('img')-\u003esrc($avatarUrl)-\u003ewidth(16);\necho Escape::html($avatarImage, ' ', $username);\n\n// \u003cimg src=\"http:/example.com/avatar.png\" width=\"16\"\u003e John Doe \u0026lt;script\u0026gt;hack\u0026lt;/script\u0026gt;\n```\n\n## Output without any escaping\n\nIn some cases you intentionally want to output variable without any escaping, but somebody other or your future self may\nmistakenly believe you forgot to escape it. Here you can use `noescape()` method to mark code as intentionally unescaped. \n\n```php\necho \\JakubBoucek\\Escape\\Escape::noescape($htmlContent);\n```\n\n## FAQ\n\n### Is it support for escaping SQL query?\n\nNo, SQL requires access to active SQL connection to right escape. This package is only allows to escape contexts without\nexternal requirements.\n\n## Contributing\nPlease don't hesitate send Issue or Pull Request.\n\n## Security\nIf you discover any security related issues, please email pan@jakubboucek.cz instead of using the issue tracker.\n\n## License\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n\n### Origin code licences\n- [New BSD License](https://github.com/nette/latte/blob/master/license.md#new-bsd-license)\n- [GNU General Public License](https://github.com/nette/latte/blob/master/license.md#gnu-general-public-license)\n\nCopyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) All rights reserved.\nPlease see [License File](https://github.com/nette/latte/blob/master/license.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubboucek%2Flegacy-escape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakubboucek%2Flegacy-escape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubboucek%2Flegacy-escape/lists"}