aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryAuthManagerInfo.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2020-12-15 20:47:15 +1100
committerTim Starling <tstarling@wikimedia.org>2020-12-16 12:21:00 +1100
commit6b2a52181fa06695a35005010a13f5ca04a706a9 (patch)
tree7ccecca64f67fb2ff10a681de58adcdf03bc7dcc /includes/api/ApiQueryAuthManagerInfo.php
parent5ebb7dd4d092c5320bb15d2deb5e2ccb112e56bb (diff)
downloadmediawikicore-6b2a52181fa06695a35005010a13f5ca04a706a9.tar.gz
mediawikicore-6b2a52181fa06695a35005010a13f5ca04a706a9.zip
Don't access $wgRequest from User
Some User methods fail if they are called before $wgRequest is set. But according to the Setup.php comment, it is only set for b/c. The global request object can be lazy-initialised at any time. This is sufficient to avoid T263911 (loss/obfuscation of the $wgServer error message). In tests, try to keep $wgRequest and RequestContext::$request in sync. Introduce MediaWikiIntegrationTestCase::setRequest() which sets both at once, and use that instead of setMwGlobals() or direct assignment. BlockManagerTest was accidentally exploiting the fact that the global context request and $wgRequest were separate objects. Making them the same causes session cookies to appear in the response, breaking the cookie counts. Use a new response for the test. Bug: T263911 Bug: T245940 Change-Id: I2be99f7251a837bc6b62be0b152038157dec10f2
Diffstat (limited to 'includes/api/ApiQueryAuthManagerInfo.php')
0 files changed, 0 insertions, 0 deletions