Jakub, I have committed your patch. It would be good if you could review
your code and fix the same errors you have fixed in the previous magic_quotes/register_globals patch - since you submitted this patch before the cleanup.
Here it is.
Thanks, committed.
Goba