'get rid off get_magic_quotes_gpc in php 8.1
I want to get rid off the get_magic_quotes_gpc function in my updated php8.1 script. I used this function in older version of my PHP but it has been depreciated. I know there are tons of threads here but as far as I checked everybody comes with different solution, is there any fixed solution and enhanced explanation of this? My codes are below :
if ( function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc() )
$value = htmlspecialchars( stripslashes((string)$value) );
else
$value = htmlspecialchars( (string)$value );
if I change the code like below will it do the same thing :
$value = htmlspecialchars( stripslashes((string)$value) );
if there is no slashes anymore then it might not be proper way to change in that way, maybe I should only add :
$value = htmlspecialchars( (string)$value );
Thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
