Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#35521 closed defect (bug) (fixed)

Avoid PHP errors if no theme directory exists

Reported by: iseulde Owned by: swissspidy
Priority: normal Milestone: 4.8
Component: Themes Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Warning: Invalid argument supplied for foreach() in .../wp-admin/theme-install.php on line 31

Warning: array_keys() expects parameter 1 to be array, boolean given in .../wp-admin/theme-install.php on line 57

Attachments (5)

35521.patch​ (856 bytes ) - added by iseulde 11 years ago.
35521.2.patch​ (697 bytes ) - added by iseulde 11 years ago.
35521.3.diff​ (1.5 KB ) - added by chris_dev 11 years ago.
I did it in a different way. I kept the search_theme_directories() function.
35521.diff​ (645 bytes ) - added by swissspidy 10 years ago.
35521.2.diff​ (479 bytes ) - added by swissspidy 10 years ago.

Download all attachments as: .zip

Change History (18)

#1 @iseulde
11 years ago

  • Keywords has-patch added

@obenland Could you take a second look?

#2 @iseulde
11 years ago

New patch, messed it up. Just make sure an array is always returned.

@chris_dev
11 years ago

I did it in a different way. I kept the search_theme_directories() function.

#3 @chris_dev
11 years ago

  • Keywords needs-testing added

#4 @chris_dev
11 years ago

  • Keywords 2nd-opinion added

#5 @obenland
11 years ago

@iseulde have you looked at #24026 and #11282?

#6 @iseulde
11 years ago

Sure, not sure if they're the same errors.

This ticket was mentioned in ​Slack in #core by chriscct7. ​View the logs.


11 years ago

#8 @kirasong
11 years ago

  • Owner set to iseulde
  • Status new → assigned

@iseulde Do you still want to tackle this in 4.5?

This ticket was mentioned in ​Slack in #core by chriscct7. ​View the logs.


11 years ago

#10 @obenland
11 years ago

  • Milestone 4.5 → Future Release

#11 @swissspidy
10 years ago

  • Owner changed from iseulde to swissspidy
  • Status assigned → reviewing

#12 @swissspidy
10 years ago

  • Keywords needs-testing 2nd-opinion removed
  • Milestone Future Release → 4.8

The first two patches could cause back compat issues. 35521.3.diff​ seems to fix things in the wrong place.

35521.diff​ is basically just one line.

#13 @swissspidy
10 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 40636:

Themes: Avoid PHP warnings in the admin when no theme directory exists.

Props iseulde, chris_dev, swissspidy.
Fixes #35521.

Note: See TracTickets for help on using tickets.