Opened 6 years ago
Closed 6 years ago
#45482 closed defect (bug) (wontfix)
PHP 5.2.17 Bug Workaround
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.9.8 |
Component: | Editor | Keywords: | has-patch reporter-feedback |
Focuses: | Cc: |
Description (last modified by )
For WordPress installations on PHP 5.2.17,
WordPress fails to run correctly because of a PHP bug, PHP reports this error:
Backend fatal error: PHP Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /wp-includes/functions.php on line 3346
Those lines are causing the problems:
$mce_init['plugins'] .= ',directionality'; $mce_init['toolbar1'] .= ',ltr';
Changing those lines to:
$mce_init['plugins'] = $mce_init['plugins'] . ',directionality'; $mce_init['toolbar1'] = $mce_init['toolbar1'] . ',ltr';
Respectively, fixes the issues for this PHP version.
It is a PHP 5.2 bug, but the workaround fixes the issue for PHP 5.2, and it doesn't affect newer versions of PHP, perhaps consider to change those 2 lines in the next release?
Thanks
Change History (8)
#3
follow-up:
↓ 4
@
6 years ago
- Component changed from General to Editor
- Keywords reporter-feedback added
@nimce Can this be duplicated without any plugins installed?
The code in question has been there since WordPress 2.5 (a time where PHP 5.2.x was much more common) in some form. Looking at the error message, it appears that it could be caused by a plugin either unsetting those array indicies or maybe inserting an array instead of a string.
Although this only affects RTL & PHP 5.2, it seems unlikely that this is something that wouldn't have been noticed sooner.
#4
in reply to:
↑ 3
@
6 years ago
Replying to dd32:
@nimce Can this be duplicated without any plugins installed?
The code in question has been there since WordPress 2.5 (a time where PHP 5.2.x was much more common) in some form. Looking at the error message, it appears that it could be caused by a plugin either unsetting those array indicies or maybe inserting an array instead of a string.
Although this only affects RTL & PHP 5.2, it seems unlikely that this is something that wouldn't have been noticed sooner.
Yeah, I can confirm this happens with a clear WordPress installation as well.
This happened to me so far with PHP 5.2.17 only.
#6
follow-up:
↓ 7
@
6 years ago
Thanks @nimce, can you debug what the $mce_init
values are at on the preceding lines at all?
I don't have access to a PHP 5.2 environment at present, but can only duplicate the issue in all versions of PHP by setting $mce_init
to a string rather than an array:
https://3v4l.org/ZVCKP
#7
in reply to:
↑ 6
@
6 years ago
Replying to dd32:
Thanks @nimce, can you debug what the
$mce_init
values are at on the preceding lines at all?
I don't have access to a PHP 5.2 environment at present, but can only duplicate the issue in all versions of PHP by setting
$mce_init
to a string rather than an array:
https://3v4l.org/ZVCKP
Sure, here is the code you provided running on PHP 5.2.17 (I have disabled reporting of notices):
https://www.profity.co.il/php-bug.php
Thanks!
WordPress works with PHP 5.2.4+