Opened 18 years ago
Closed 18 years ago
#6210 closed defect (bug) (fixed)
Impossible to add widgets on some platforms
| Reported by: | mdawaffe | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.5 |
| Component: | General | Version: | 2.5 |
| Severity: | blocker | Keywords: | has-patch commit |
| Cc: | Focuses: |
Description
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).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
(In [7281]) Avoid integer overflow with widget IDs. Props mdawaffe. fixes #6210