WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#37227 closed defect (bug) (fixed)

PHP 7 compatibilty issues in twentythirteen and twentyfourteen

Reported by: xknown Owned by: karmatosed
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

While running the php7cc tool, it reported two incompatibilities for the above mentioned themes.

PHP 7 changes the behavior of the foreach loop. It doesn't longer modify the internal array pointer, thus using it with current/reset/etc doesn't produce the expected results.

You can see the different results for PHP 5.x vs PHP 7.x https://3v4l.org/oQiI9

The problematic lines are in the following methods

  • twentythirteen_the_attached_image - #
  • twentyfourteen_the_attached_image - #

Attachments (2)

37227-twentythirteen.diff (614 bytes) - added by xknown 5 years ago.
Patch for twentythirteen
37227-twentyfourteen.diff (614 bytes) - added by xknown 5 years ago.
Patch for twentyfourteen

Download all attachments as: .zip

Change History (6)

@xknown
5 years ago

Patch for twentythirteen

@xknown
5 years ago

Patch for twentyfourteen

#1 @xknown
5 years ago

  • Keywords has-patch added

You can see the output of the proposed patches in https://3v4l.org/2SPQf

cc @davidakennedy @karmatosed

#2 @davidakennedy
5 years ago

This would be good to do, and the patch is similar to changes made to dozens of themes on WordPress.com with no issues.

#3 @karmatosed
5 years ago

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

In 38026:

PHP 7 compatibility issues fixed in Twenty Thirteen and Twenty Fourteen
Props xknown
Fixes #37227
--This Line, and those below, will be ignored--

M themes/twentyfourteen/functions.php
M themes/twentythirteen/functions.php

#4 @ocean90
5 years ago

  • Milestone changed from Awaiting Review to 4.6
Note: See TracTickets for help on using tickets.