SimpleMachines/SMF2.1 — pull request #2417 by Oldiesmann (2014-10-09 16:24:21+00:00)
Title: ! The menu code didn't handle invalid "current_area" values properly, wh...

...ich could cause errors (fixes #2414)

This just moves two sections of code to fix a couple of issues:
1. The $backup_area, which is used as the current area if we didn't find a section for the original "current area", was being set outside the loop that goes through each area, which would result in it being set to the *last* area of a section, rather than the first.

2. The current area was not validated and set to $backup_area until after we already specified that its menu item should be selected. This caused the invalid area to be added to the current section's areas, which in turn caused the errors since no menu data was defined for that area.

Signed-off-by: Michael Eshom