Make WordPress Core

Opened 15 months ago

Closed 15 months ago

Last modified 10 months ago

#23232 closed defect (bug) (fixed)

[E_STRICT] mo.php import_from_reader

Reported by: zenation Owned by: SergeyBiryukov
Milestone: 3.6 Priority: normal
Severity: minor Version: 3.5
Component: Warnings/Notices Keywords: has-patch commit
Focuses: Cc:


I'm getting a STRICT error for /wp-includes/pomo/mo.php saying that only variables should be passed by reference. So my suggestion is to replace line 210 (function: import_from_reader)


with these two lines

 $translationHeaders = $this->make_headers( $translation );
 $this->set_headers( $translationHeaders );

I'm looking @version $Id: mo.php 718 2012-10-31 00:32:02Z nbachiyski $

Attachments (2)

23232.patch (1.1 KB) - added by SergeyBiryukov 15 months ago.
23232.2.patch (621 bytes) - added by SergeyBiryukov 15 months ago.

Download all attachments as: .zip

Change History (16)

SergeyBiryukov15 months ago

comment:1 SergeyBiryukov15 months ago

  • Component changed from General to Warnings/Notices
  • Milestone changed from Awaiting Review to 3.6

Fixed in [19072], reintroduced in [22349].

comment:2 SergeyBiryukov15 months ago

  • Keywords has-patch commit added

comment:3 SergeyBiryukov15 months ago

  • Cc nbachiyski added

comment:4 nbachiyski15 months ago

Go ahead and commit it, it's on my list to make sure the WordPress version of pomo is the canonical one.

comment:5 nacin15 months ago

Actually, nikolay, I'm wondering why $headers is by reference. I think we could remove it, given that we're not doing anything to $headers (and likely never would want to).

comment:6 nbachiyski15 months ago

@nacin, we have a ton of references still from the old PHP4 days when objects were copied if not passed by reference. We probably don't need most of them.

comment:7 follow-up: wonderboymusic15 months ago

we did a lot of that here [21839] and then broke i18n as per Sergey

comment:8 in reply to: ↑ 7 nbachiyski15 months ago

Replying to wonderboymusic:

we did a lot of that here [21839] and then broke i18n as per Sergey

Did you really mean [21839]?

comment:9 wonderboymusic15 months ago

argh, that was meant to be #21839 - commits were [21792] and [21793]

Last edited 15 months ago by wonderboymusic (previous) (diff)

SergeyBiryukov15 months ago

comment:10 SergeyBiryukov15 months ago

Removing the reference (23232.2.patch) actually works too.

comment:11 nacin15 months ago

This isn't a PHP4-style reference. It's taking an array of headers by reference, but then not changing said array, making the reference fairly useless. I'm fine with removing it. Would be good to see if blaming this gleans any light.

comment:12 SergeyBiryukov15 months ago

Introduced in [10584] along with the pomo library itself.

comment:13 SergeyBiryukov15 months ago

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

In 23357:

Avoid 'Only variables should be passed by reference' warning. fixes #23232.

comment:14 ocean9010 months ago

#24699 was marked as a duplicate.

Note: See TracTickets for help on using tickets.