{"id":37233242,"url":"https://github.com/abreksa4/mysql-escape-string-polyfill","last_synced_at":"2026-01-15T03:53:15.643Z","repository":{"id":56947961,"uuid":"175387631","full_name":"abreksa4/mysql-escape-string-polyfill","owner":"abreksa4","description":"a very insecure mysql_escape_string implementation for a very limited use case","archived":false,"fork":false,"pushed_at":"2025-02-28T15:29:25.000Z","size":27,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T13:59:58.939Z","etag":null,"topics":["dont-use-this-no-really","ext-mysql","insecure","mysql","mysql-escape-string","php","polyfill"],"latest_commit_sha":null,"homepage":"https://abreksa4.github.io/mysql-escape-string-polyfill/","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/abreksa4.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}},"created_at":"2019-03-13T09:24:28.000Z","updated_at":"2025-02-28T15:29:29.000Z","dependencies_parsed_at":"2022-08-21T08:20:15.317Z","dependency_job_id":null,"html_url":"https://github.com/abreksa4/mysql-escape-string-polyfill","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/abreksa4/mysql-escape-string-polyfill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abreksa4%2Fmysql-escape-string-polyfill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abreksa4%2Fmysql-escape-string-polyfill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abreksa4%2Fmysql-escape-string-polyfill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abreksa4%2Fmysql-escape-string-polyfill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abreksa4","download_url":"https://codeload.github.com/abreksa4/mysql-escape-string-polyfill/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abreksa4%2Fmysql-escape-string-polyfill/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28442357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"online","status_checked_at":"2026-01-15T02:00:08.019Z","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":["dont-use-this-no-really","ext-mysql","insecure","mysql","mysql-escape-string","php","polyfill"],"created_at":"2026-01-15T03:53:14.992Z","updated_at":"2026-01-15T03:53:15.636Z","avatar_url":"https://github.com/abreksa4.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"mysql-escape-string-polyfill\n----------------------------\n[![Build Status](https://travis-ci.org/abreksa4/mysql-escape-string-polyfill.svg?branch=master)](https://travis-ci.org/abreksa4/mysql-escape-string-polyfill)\n[![codecov](https://codecov.io/gh/abreksa4/mysql-escape-string-polyfill/branch/master/graph/badge.svg)](https://codecov.io/gh/abreksa4/mysql-escape-string-polyfill)\n\nmysql-escape-string-polyfill is a very insecure `mysql_escape_string` implementation (PHP 7.1/7.2) for a very limited use case \n\n# Usage\n1. Install this package via composer: `composer require andrewbreksa/mysql-escape-string-polyfill`\n2. Find all the places you use the `mysql_*` functions, and refactor your code to use PDO\n\n# Limitations\n- Uses the following map to replace characters in a string:\n    ```php\n    $replacementMap = [\n        \"\\0\" =\u003e \"\\\\0\",\n        \"\\n\" =\u003e \"\\\\n\",\n        \"\\r\" =\u003e \"\\\\r\",\n        \"\\t\" =\u003e \"\\\\t\",\n        chr(26) =\u003e \"\\\\Z\",\n        chr(8) =\u003e \"\\\\b\",\n        '\"' =\u003e '\\\"',\n        \"'\" =\u003e \"\\'\",\n        '_' =\u003e \"\\_\",\n        \"%\" =\u003e \"\\%\",\n        '\\\\' =\u003e '\\\\\\\\'\n    ];\n    ```\n- Not very comprehensively tested, this will be an ongoing effort as new edge cases are discovered\n\n# Hacking on the complex source code\nThe implementation can be found in [functions.php](./src/functions.php), and you can run tests by executing `composer test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabreksa4%2Fmysql-escape-string-polyfill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabreksa4%2Fmysql-escape-string-polyfill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabreksa4%2Fmysql-escape-string-polyfill/lists"}