Make WordPress Core

Opened 17 years ago

Closed 14 years ago

Last modified 14 years ago

#12367 closed defect (bug) (invalid)

Fixes for deprecated assignment of new objects by reference

Reported by: technosailor Owned by: westi
Priority: normal Milestone:
Component: Warnings/Notices Version: 3.2
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

SimplePie does a whole lot of instantiation of classes by reference which is now deprecated in PHP 5.3. Though I don't want to do a lot of patching on an upstream library, I think this is an important thing to fix in WP 3.0.

Attachments (3)

simplepie_deprecated_notices.diff (46.0 KB ) - added by technosailor 17 years ago.
fix_assign_new_by_reference.diff (50.0 KB ) - added by mrtorrent 15 years ago.
Fixes all instances of deprecated assignment by reference of new objects
fix_assign_new_by_reference.2.diff (59.1 KB ) - added by mrtorrent 15 years ago.
Updated: Fixes all instances of deprecated assignment by reference of new objects

Download all attachments as: .zip

Change History (22)

#1 @nacin
17 years ago

  • Resolutionwontfix
  • Status newclosed

These are necessary for PHP 4 compatibility, as objects in PHP 4 are copied unless passed by reference. We uses this throughout core and deliberately suppress E_DEPRECATED (even when WP_DEBUG).

#2 @nacin
16 years ago

  • Milestone 3.0

#3 @scottconnerly
15 years ago

  • Resolution wontfix
  • Status closedreopened

WP 3.2 now requires PHP 5. It would be appropriate to upgrade simplepie to their master branch now.

#4 @scottconnerly
15 years ago

  • Cc scottconnerly added

#5 @SergeyBiryukov
15 years ago

  • MilestoneAwaiting Review

#6 @rmccue
15 years ago

1.3-dev (the master branch) is unstable, so I wouldn't update to it yet. It's very unlikely that there will be more bugs, but the library has been somewhat reorganised, so it's possible that more bugs will have been introduced.

@mrtorrent
15 years ago

Fixes all instances of deprecated assignment by reference of new objects

#7 @mrtorrent
15 years ago

  • Cc mrtorrent@… added
  • Keywords needs-testing removed

Hi everyone, I've attached a patch against current trunk to correct all instances of new objects being assigned by reference.

@mrtorrent
15 years ago

Updated: Fixes all instances of deprecated assignment by reference of new objects

#8 @mrtorrent
15 years ago

  • Summary SimplePie E_DEPRECATED fixesFixes for deprecated assignment of new objects by reference
  • Version3.3

Apologies, first patch was incomplete. Corrected patch attached.

Changed issue summary as this now addresses all instances of assignment of new objects by reference and therefore fixes the remaining E_DEPRECATED warnings.

Can this make it into 3.3?

#9 @rmccue
15 years ago

From my point of view, WordPress having a customised version of SimplePie makes it much harder for me to maintain, so I'd prefer to avoid that.

1.2 would most likely be fine to use, but it doesn't have as much testing as I'd like. In addition, it has quite a few backwards incompatibilities. If you'd like to roll that into 3.3, I'll see if I can get some more tests in the mean time.

#10 @mrtorrent
15 years ago

Wordpress already uses Simplepie 1.2. How do these fixes make things harder to maintain?

From my point of view, deprecated PHP4 code like this makes it harder to maintain modern code because it interferes with tests and obviously may break future versions of PHP.

#11 @rmccue
15 years ago

Sorry, I meant 1.3. This is what I get for writing comments before I'm awake. :)

1.3 is the development version, and the first to drop PHP 4 compatibility. It also features major changes (internally, and a few to the API), so I'd like to actually release it before it gets used.

#12 follow-up: @nacin
15 years ago

We don't hack external libraries for things like this, so let's exclude TextDiff and SimplePie from the patch.

Optionally, check to see if TextDiff has been updated upstream.

#13 in reply to: ↑ 12 @mrtorrent
15 years ago

Replying to nacin:

We don't hack external libraries for things like this, so let's exclude TextDiff and SimplePie from the patch.

Optionally, check to see if TextDiff has been updated upstream.

I can understand not wanting to fork functionally from a 3rd-party library so that patches don't have to be maintained, but this is a small compatibility fix that is essentially incorporated in newer versions of both libraries. It fixes a current issue without breaking anything and will not have to be forward-ported if the included versions are updated in the future, so where's the harm?

#14 @nacin
15 years ago

  • Version 3.33.2

Maintaining a forked version of an external library is an extra burden we'd rather not deal with, especially for suppressed notices that have no real effect. It'd be a better use of time to go through with upgrades to newer versions of both libraries.

#15 @SergeyBiryukov
15 years ago

Closed #12709 as a duplicate.

set_magic_quotes_runtime() (used in PclZip and PHPMailer) is also deprecated.

#16 @ocean90
15 years ago

Duplicate of the SimplePie part: #20139

#18 @wonderboymusic
14 years ago

  • Milestone Awaiting Review
  • Resolutionwontfix
  • Status reopenedclosed

This is even fixed in TextDiff now, (although there are 5 lingering instances of a callable with &$this, but not an issue)

#19 @helen
14 years ago

  • Resolution wontfixinvalid
Note: See TracTickets for help on using tickets.