WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10222 closed defect (bug) (fixed)

Fatal error: Trying to clone an uncloneable object of class ReflectionClass in /var/www/htdocs/syz/html/wp-includes/class-simplepie.php on line 11739...

Reported by: codestyling Owned by:
Milestone: 2.8.1 Priority: highest omg bbq
Severity: blocker Version: 2.8
Component: Administration Keywords: malfunction of wordpress scripting
Focuses: Cc:

Description

This is no direct issue of WordPress own code but inside the shipped SimplePie classes. They use Reflections code, which is only available at PHP5.
Furthermore the addressed line tries to clone using Reflection API a class and crashes while the provider didn't configure a specific setting correctly. Reflections only works properly if

zend.ze1_compatibility_mode=Off in php.ini

as can be read here http://docs.php.net/manual/de/language.oop5.reflection.php#79578 and has been tested successfully by an user of german WordPress forum have had this issue.

I don't know, how the solution could look like, because this are more issues in one case:

  • PHP 5 usage (even if WordPress claims to be compatible with PHP 4)
  • wrong provider setting avoid proper function of WordPress if using PHP 5

One possible solution could be to show up during install the test result of reading this value and in case of PHP 5 and On a warning could be presented.
I'm afraid, this is not the best solution but it is one. Please find a way to handle this type of issue safely.

Attachments (2)

simple-pie-php5.patch (548 bytes) - added by codestyling 5 years ago.
10222.diff (5.1 KB) - added by ryan 5 years ago.
Port of r1053 from upstream

Download all attachments as: .zip

Change History (18)

comment:1 dd325 years ago

  • Component changed from Upgrade/Install to Administration
  • Keywords crash removed
  • Owner dd32 deleted

PHP 5 usage (even if WordPress claims to be compatible with PHP 4)

The version of SimplePie in use is PHP4 compatible, The ReflectionClass is only used if that extension is available (Which its not on PHP4 obviously)

wrong provider setting avoid proper function of WordPress if using PHP 5

Host mis-configurations are probably outside of the scope of what wordpress should be alerting on..

comment:2 codestyling5 years ago

  • Keywords malfunction of wordpress scripting added
  • Priority changed from high to highest omg bbq
  • Severity changed from critical to blocker

After testing this setting on PHP 5 version set to On the Dashboard comes up but nothing was working, no javascript will be delivered, the quick edit is missing, the RSS boxes are missing and no javascript based interaction is possible!

I attached a patch for SimplePie disables PHP 5 usage more specific but this doesn't solve the malfunction of Dashboard or entire WP. Furthermore no TinyMCE Editor can be used, simply nothing requires javascripts is working.

Please check and test it, why this set WordPress out of function in this way.

comment:3 follow-up: dd325 years ago

simply nothing requires javascripts is working.

Have you disabled All plugins and switched to the default theme? Some plugins load incompatible versions of Javascript libraries, such as jQuery, which can cause issues like no JS loading..

comment:4 in reply to: ↑ 3 codestyling5 years ago

Replying to dd32:

simply nothing requires javascripts is working.

Have you disabled All plugins and switched to the default theme? Some plugins load incompatible versions of Javascript libraries, such as jQuery, which can cause issues like no JS loading..

Yes, i did. WP 2.8 in pure install, default theme and no plugins.
The Dasboard is damaged because of

<b>Fatal error</b>:  Trying to clone an uncloneable object of class ReflectionClass in <b>C:\Program Files (x86)\xampp\htdocs\_root_wp28\wp-includes\class-simplepie.php</b> on line <b>11740</b><br />

this is again driven by a missing PHP 5 test even if the constant now respects mis-configuration:

	function SimplePie_Parse_Date()
	{
		$this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')';
		$this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')';

		static $cache;
		if (!isset($cache[get_class($this)]))
		{
			if (extension_loaded('Reflection'))
			{
				$class = new ReflectionClass(get_class($this));

No safety test is made to test if a PHP 5 can be used.

comment:5 dd325 years ago

Oh now i understand.

I suggest you submit the patch upstream to the SimplePie bug tracker then as well.

comment:6 codestyling5 years ago

But i'm afraid there have to be spend more time to solve all inside SimplePie, because i did now some more safety checks inplace (additional patches) and got now the Quick edit back and also some feeds but in the last 2 feed boxes now this occures:

Fatal error: Maximum execution time of 60 seconds exceeded in C:\Program Files (x86)\xampp\htdocs\_root_wp28\wp-includes\class-simplepie.php on line 3087

This is related to the destruction of SimplePie element here:

	/**
	 * Remove items that link back to this before destroying this object
	 */
	function __destruct()
	{
			unset($this->feed);
	}

ryan5 years ago

Port of r1053 from upstream

comment:8 ryan5 years ago

Patch ports relevant parts of upstream fix:

http://bugs.simplepie.org/repositories/revision/sp1/1053

comment:9 ryan5 years ago

Patch does avoid the errors, but the dashboard modules are really slow to load or don't load at all with zend.ze1_compatibility_mode on.

comment:10 codestyling5 years ago

The patch of SimplePie has been made to avoid this issue at: http://bugs.simplepie.org/repositories/diff/sp1/trunk/simplepie.inc?rev=1058
Could this be merged somehow ?

comment:11 ryan5 years ago

That fixes the PHP5 cases but blows up PHP4. See the note on ticket 135.

comment:12 ryan5 years ago

I did both 1053 and 1058, BTW. Should I just use 1058?

comment:13 ryan5 years ago

1058 by itself doesn't seem to help. Looks like we need both, but need a different means of looping on that one line. Maybe do a for loop instead of foreach?

comment:14 ryan5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [11657]) Fix compat with zend.ze1_compatibility_mode. Props gsnedders. fixes #10222 for trunk

comment:15 ryan5 years ago

(In [11658]) Fix compat with zend.ze1_compatibility_mode. Props gsnedders. fixes #10222 for 2.8.1

comment:16 ryan5 years ago

Tested with zend.ze1_compatibility_mode off and on for both PHP 4 and 5.

Note: See TracTickets for help on using tickets.