Make WordPress Core

Opened 11 years ago

Closed 11 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:


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 11 years ago.
if(is_array($indices)) Diff

Download all attachments as: .zip

Change History (4)

11 years ago

if(is_array($indices)) Diff

#1 @arnee
11 years ago

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

#2 @foolswisdom
11 years ago

  • Milestone changed from 2.2.3 to 2.3

#3 @markjaquith
11 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.