Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FILTER_SANITIZE Deprecated #12

Open
ShadowVoid-King opened this issue Oct 30, 2024 · 0 comments
Open

FILTER_SANITIZE Deprecated #12

ShadowVoid-King opened this issue Oct 30, 2024 · 0 comments

Comments

@ShadowVoid-King
Copy link

ShadowVoid-King commented Oct 30, 2024

$filterdUser = filter_var($username, FILTER_SANITIZE_STRING);
$filterdEmail = filter_var($email, FILTER_SANITIZE_EMAIL);

in php 8.1.0 i think alternative can be one of next solution so which one is best practices and why ?

$filterUser = strip_tags(filter_var(htmlspecialchars($_POST['username'], ENT_QUOTES, 'UTF-8'), FILTER_SANITIZE_FULL_SPECIAL_CHARS)); // Work Too

$filterUser = htmlspecialchars((strip_tags($_POST['username'])), ENT_QUOTES, 'UTF-8'); // Work Too
  • Files
    ‎FILTER_SANITIZE_STRING‎
    6 ReferencesSearch

‎In this file‎

> Line Number

$filterdUser = filter_var($username, FILTER_SANITIZE_STRING); > 61

‎newad.php‎
			$name 		= filter_var($_POST['name'], FILTER_SANITIZE_STRING); > 12
			$desc 		= filter_var($_POST['description'], FILTER_SANITIZE_STRING); > 13
			$country 	        = filter_var($_POST['country'], FILTER_SANITIZE_STRING); > 15
			$tags 		= filter_var($_POST['tags'], FILTER_SANITIZE_STRING); > 18

‎items.php‎
			$comment 	= filter_var($_POST['comment'], FILTER_SANITIZE_STRING); > 101

@ElzeroWebSchool @OsamaElzero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant