Rather than passing the whole $_SESSION to FauxRequest, how about just constructing an array with the variables you need?
I was hoping we could fix this in a better way, by either
Thoughts?
Of those three, only 3 is could be used imho. The other ones smell like globals. I find the current solution acceptable.
Did #3 in r102949.
...and reverted. But none of that is needed now that we have DerivativeRequest, which should be used instead of FauxRequest in 1.19+.
In my opinion this is just a quick fix. A better way to solve this issue was suggested by Daniel Friesen. This would probably result in a major refactoring of the method and so I shied away from it.
MAH removed 1.18 tag Nov. 7. Fixes bug 31613, is live on 1.18WMF1. Please consider backporting to 1.18.