I\'m getting this message when I try to run a php script I have to use but did not write.
Deprecated: Function set_magic_quotes_runtime() is deprecated in /o
In PHP 7 we can use:
ini_set('magic_quotes_runtime', 0);
instead of set_magic_quotes_runtime(0);
add these code into the top of your script to solve problem
@set_magic_quotes_runtime(false);
ini_set('magic_quotes_runtime', 0);
Update this function :
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
set_magic_quotes_runtime(0);
}
else {
ini_set('magic_quotes_runtime', 0);
}
$magic_quotes = get_magic_quotes_runtime();
$file_buffer = fread($fd, filesize($path));
$file_buffer = $this->EncodeString($file_buffer, $encoding);
fclose($fd);
if ($magic_quotes) {
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
set_magic_quotes_runtime($magic_quotes);
}
else {
ini_set('magic_quotes_runtime', $magic_quotes);
}
}
return $file_buffer;
Since Magic Quotes is now off by default (and scheduled for removal), you can just remove that function call from your code.