Skip to content

Commit

Permalink
Fix for PHP 7.4
Browse files Browse the repository at this point in the history
Function get_magic_quotes_runtime() is deprecated
Function get_magic_quotes_gpc() is deprecated
  • Loading branch information
MioVisman committed Nov 28, 2019
1 parent ae6d19f commit 00b4882
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion admin/db_update.php
Expand Up @@ -48,7 +48,7 @@
error_reporting(E_ALL);

// Turn off magic_quotes_runtime
if (get_magic_quotes_runtime())
if (version_compare(PHP_VERSION, '7.4.0', '<') && get_magic_quotes_runtime())
@ini_set('magic_quotes_runtime', false);

// Turn off PHP time limit
Expand Down
2 changes: 1 addition & 1 deletion admin/install.php
Expand Up @@ -377,7 +377,7 @@ function generate_config_file()
//
function unescape($str)
{
return (get_magic_quotes_gpc() == 1) ? stripslashes($str) : $str;
return (version_compare(PHP_VERSION, '7.4.0', '<') && get_magic_quotes_gpc() == 1) ? stripslashes($str) : $str;
}


Expand Down
4 changes: 2 additions & 2 deletions include/common.php
Expand Up @@ -15,11 +15,11 @@
require FORUM_ROOT.'include/essentials.php';

// Turn off magic_quotes_runtime
if (get_magic_quotes_runtime())
if (version_compare(PHP_VERSION, '7.4.0', '<') && get_magic_quotes_runtime())
@ini_set('magic_quotes_runtime', false);

// Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled)
if (get_magic_quotes_gpc())
if (version_compare(PHP_VERSION, '7.4.0', '<') && get_magic_quotes_gpc())
{
function stripslashes_array($array)
{
Expand Down

0 comments on commit 00b4882

Please sign in to comment.