Make WordPress Core

Opened 8 years ago

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

Download all attachments as: .zip

Change History (4)

8 years ago

if(is_array($indices)) Diff

#1 @arnee
8 years ago

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

#2 @foolswisdom
8 years ago

  • Milestone changed from 2.2.3 to 2.3

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