WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#5047 closed defect (bug) (fixed)

dbDelta generates E_WARNING if no indices are defined

Reported by: arnee Owned by: arnee
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.3
Component: Optimization Keywords: has-patch
Focuses: Cc:

Description

dbDelta tries to loop through the array of indexes with foreach, but this array is NULL if no indexes are defined. Foreach with NULL => E_WARNING

Solution: Check if $indices is an array

Attachments (1)

dbDelta.diff (545 bytes) - added by arnee 7 years ago.
if(is_array($indices)) Diff

Download all attachments as: .zip

Change History (4)

@arnee7 years ago

if(is_array($indices)) Diff

comment:1 @arnee7 years ago

  • Keywords has-patch added
  • Status changed from new to assigned

comment:2 @foolswisdom7 years ago

  • Milestone changed from 2.2.3 to 2.3

comment:3 @markjaquith7 years ago

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

(In [6158]) Cast to array in upgrade foreach(). props arnee. fixes #5047

Note: See TracTickets for help on using tickets.