Guicontrols and redirects

Hi!

There is a bug when using guicontrols with ajax functionality and as far as I know, it is not solved in 1.5

Replicate it like this:
Build a form, any form, but make sure you have a validation rule that you can break. (e.g. an input that must not be left empty)

Make a call in the same page using ajax. Then submit the form, but do not fill in the required field.

Instead of taking you back to the form, you will reach the URL that you've requested with ajax.
(the same if you access any other page within a zone - just open up another tab BEFORE you submit the invalid form).

Why?

There is a session var $sUrls in the session component, that tracks the last 20 links you've visited.
Those links are used by the guicontrol component to redirect you back to the form if there is a validation error.
If the last link you accessed is different than the form itself, it will not know and the redirect will miss.

How to best go about fixing this?