#9394 closed defect (bug) (fixed)
set_magic_quotes_runtime deprecated in PHP 5.3
| Reported by: | sojweb | Owned by: | sojweb |
|---|---|---|---|
| Priority: | low | Milestone: | 3.3 |
| Component: | Warnings/Notices | Version: | 2.8.1 |
| Severity: | minor | Keywords: | |
| Cc: | Focuses: |
Description
In PHP 5.3, the set_magic_quotes_runtime() function in wp-settings.php has been deprecated and gives an error. I propose two ways of addressing this, one to simply suppress the error, another to do a version test. The version test method would be better should the function ever be removed from PHP.
Attachments (2)
Change History (22)
#1
in reply to: ↑ description
@
18 years ago
#3
@
18 years ago
This is definitely related to #8701. But given that support will be completely removed for this at some point, playing around with error reporting levels is, at best, a temporary fix. Probably the only way to handle it properly is to break backward compatibility, do version testing, or create the wp-settings.php file at install time with the appropriate code.
#4
follow-up:
↓ 5
@
18 years ago
How about testing for "features"? Easy enough to do here:
if ( function_exists('set_magic_quotes_runtime')
set_magic_quotes_runtime(0);
#5
in reply to: ↑ 4
@
18 years ago
Replying to azaozz:
How about testing for "features"? Easy enough to do here:
if ( function_exists('set_magic_quotes_runtime') set_magic_quotes_runtime(0);
This does not cover deprecated. PHP6 isn't going to be released in a while, so covering support for it now, doesn't seem like a good idea.
#8
@
17 years ago
- Milestone Unassigned → 2.8
- Severity normal → major
hasn't this been fixed in trunk via #8701?
#10
@
17 years ago
- Component General → Warnings/Notices
- Milestone 2.8 → Future Release
- Priority normal → low
- Resolution duplicate
- Severity major → minor
- Status closed → reopened
- Version 2.7.1 → 2.8.1
#8701 would seem to just hide the issue of using the deprecated function, not fix the issue. Reopening.
$ ack set_magic_quotes_runtime -l wp-admin/import/blogware.php wp-admin/import/dotclear.php wp-admin/import/rss.php wp-admin/import/textpattern.php wp-admin/import/wordpress.php wp-admin/includes/class-pclzip.php wp-includes/class-phpmailer.php wp-settings.php
#11
@
17 years ago
- Keywords php 5.3 set_magic_quotes_runtime has-patch tested removed
in this case it should version compare < 5.3
#12
@
16 years ago
- Cc added
Just encountered this issue. caused the firestats plugin not to work because the deprecation notice was output into the JS file it generates on the fly. I would suggest to bump up the priority/severity of this bug.
#13
@
16 years ago
Why is it outputting JS on the fly? admin-ajax? wp_localize_script?
E_DEPRECATED is silenced by WP. I consider this ticket wontfix.
#14
@
16 years ago
Looks like it blows up in PHP6 (per hearsay reports - the evidence is circumstantial.)
#15
@
16 years ago
PHP6 development was moved to a branch some time ago because Unicode support was too difficult to implement. We won't be needing to make a decision on this for a few years.
#16
@
15 years ago
- Cc added
I am on PHP Version 5.3.5 and it just showed up. Would be nice to have this resolved.
#17
@
15 years ago
it would be nice to not have this in the logs on every single request ( when error_reporting(-1) is set )
I don’t understand the hesitance to just switch to ini_set? The next line does it properly:
// Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php. set_magic_quotes_runtime( 0 ); @ini_set( 'magic_quotes_sybase', 0 );
#18
@
15 years ago
- Milestone Future Release → 3.3
- Resolution → fixed
- Status reopened → closed
Fixed in [18549].
#19
@
15 years ago
Thanks for fixing. Just ran over it, changed a 3.2.1 install, fixed my warning issue.
#20
@
10 years ago
Hello guys
I was performing a compatibility test with PHP Code Sniffer using PHPCompatibility / PHPCompatibility for migrating to PHP 7 and I've got the errors bellow. Once this error was fixed in [18549] I believe it is something that I do not need to be concerned about. Anyway I wanted to check if anyone had any issue with class-pclzip.php running on a PHP 7.
Thank you
[1mFILE: ...rowdyhouse/crowdyhouse-github/wp-admin/includes/class-pclzip.php[0m
----------------------------------------------------------------------
[1mFOUND 2 ERRORS AFFECTING 2 LINES[0m
----------------------------------------------------------------------
5345 | [31mERROR[0m | [1mFunction set_magic_quotes_runtime() is deprecated since
| | PHP 5.3 and removed since PHP 7.0[0m
| | (PHPCompatibility.PHP.DeprecatedFunctions.set_magic_quotes_runtimeDeprecatedRemoved)
5376 | [31mERROR[0m | [1mFunction set_magic_quotes_runtime() is deprecated since
| | PHP 5.3 and removed since PHP 7.0[0m
| | (PHPCompatibility.PHP.DeprecatedFunctions.set_magic_quotes_runtimeDeprecatedRemoved)
----------------------------------------------------------------------
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Meant to add this in the original description: Magic quotes are disabled by default in 5.3, and removed in PHP 6 http://us2.php.net/magic_quotes