PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, March 5, 2022

[FIXED] How to replace get_magic_quotes_runtime() in PHP7.4

 March 05, 2022     deprecated, php     No comments   

Issue

The function get_magic_quotes_runtime is deprecated in PHP 7.4 as per documantation.

This function has been DEPRECATED as of PHP 7.4.0. Relying on this function is highly discouraged.

How to replace it with a valid code with the same functionality?

A particular example PunBB v1.4.5, file: common.php line 18:

// Turn off magic_quotes_runtime
if (get_magic_quotes_runtime()) {
    @ini_set('magic_quotes_runtime', false);
}

Solution

Well it is a reference to magic_quotes_runtime which is itself deprecated as of PHP 5.3 and REMOVED in PHP 5.4 so you have no need to use get_magic_quotes_runtime in PHP 7.4

So you can simply update your code accordingly:

/***
 * Turn off magic_quotes_runtime
 * this function serves no purpose
if (get_magic_quotes_runtime()) {
    @ini_set('magic_quotes_runtime', false);
}
***/

Edit: This is just an example, you can simply delete your shown code ;-)



Answered By - Martin
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing