{"id":23248903,"url":"https://github.com/sinhapaurush/protection","last_synced_at":"2025-04-06T01:20:54.075Z","repository":{"id":113435326,"uuid":"514328442","full_name":"sinhapaurush/protection","owner":"sinhapaurush","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-15T16:18:28.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T07:25:46.614Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinhapaurush.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,"governance":null}},"created_at":"2022-07-15T16:03:44.000Z","updated_at":"2022-07-15T16:04:53.000Z","dependencies_parsed_at":"2023-12-04T18:09:01.913Z","dependency_job_id":null,"html_url":"https://github.com/sinhapaurush/protection","commit_stats":null,"previous_names":["fuhrerindia/protection","sinhapaurush/protection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhapaurush%2Fprotection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhapaurush%2Fprotection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhapaurush%2Fprotection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhapaurush%2Fprotection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinhapaurush","download_url":"https://codeload.github.com/sinhapaurush/protection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247421129,"owners_count":20936234,"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-12-19T08:16:06.992Z","updated_at":"2025-04-06T01:20:54.050Z","avatar_url":"https://github.com/sinhapaurush.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# String Protection\nThis library have simple functions to replace special charecters from strings, in order to prevent XSS and SQL Injecion attacks on file.\n\n## clean()\nRemoves all special charecters including spaces. This function ignores '@' and '.' making it suitable for E-Mail addresses.\n\n## cleanWithSpaces()\nRemoves all special charecters, excluding spaces and '@'.\n\n## linient()\nOnly removes --, ', \" and % making less vulnerable to SQL Injection.\n\n### Example\n$email = $_POST['mail'];\n$pass = $_POST['pass'];\n$query = \"SELECT * FROM table WHERE email = '{$email}' AND password='{$pass}'\";\n// ABOVE QUERY WILL BREAK IF USER/HACKER TRIES TO PASS ' in variable or hacker can externally modify this query due to this raw variable, check how below.\n\nIf hacker tries to bypass password, then he can try to pass \"abc@xyz.com'--\" to bypass it, so clean() will help here.\nSaving variables like below can help\n$email = clean($_POST['mail']);\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinhapaurush%2Fprotection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinhapaurush%2Fprotection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinhapaurush%2Fprotection/lists"}