Fix the magic quotes deprecated in php 7

+2 votes
353 views
asked Feb 14 in General by Dip

How to fix magic quotes deprecated in php7 ?

Having checked the error log in the folder I see the reason for the 500 error was Magic Quotes runtime being required. The site was running on PHP7 and this feature was removed from PHP7 before release so that explains the error (http://php.net/manual/en/function.set-magic-quotes-runtime.php). Switching back to PHP 5.6 fixed this. But it cant be switched off for long.

Please help!

1 Answer

+1 vote
answered Feb 14 by anonymous

use addslashes() for every $GET and $POST variable. It does the same manually what magic_quotes switched on did with all $GET and $POST variables. But i really guess its less work to use mysqli with mysqli_real_escape_string or better, prepared statements :)

http://php.net/manual/de/function.addslashes.php

Related questions

0 votes
2 answers 82 views
0 votes
1 answer 50 views
asked Aug 19, 2016 in General by Azi Graeber
0 votes
1 answer 425 views
0 votes
1 answer 237 views
0 votes
3 answers 707 views
asked May 25, 2016 in Magento by David
0 votes
1 answer 411 views
...