Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#6210 closed defect (bug) (fixed)

Impossible to add widgets on some platforms

Reported by: mdawaffe Owned by:
Milestone: 2.5 Priority: normal
Severity: blocker Version: 2.5
Component: General Keywords: has-patch commit
Focuses: Cc:
PR Number:


The new multiwidgets use {time() . incrementor} as their widget ids in order to avoid collisions.

Those ids are over 2^33 which, on some platforms, causes array_map() inside add_magic_quotes( $_POST ) or stripslashes_deep( $_POST ) to mis-map those large array keys.

The end result is a mismatch between array keys and array values when trying to add widgets. The addition fails.

Attached changes the widget ids to be {( time() - 1199145600 ) . incrementor} (1199145600 is January 1st, 2008). This gives us about 27 years of breathing room before we run into the bug again (at least on the 2^33-limited box I was testing with).

Attachments (1)

6210.diff (641 bytes) - added by mdawaffe 12 years ago.

Download all attachments as: .zip

Change History (2)

12 years ago

#1 @ryan
12 years ago

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

(In [7281]) Avoid integer overflow with widget IDs. Props mdawaffe. fixes #6210

Note: See TracTickets for help on using tickets.