https://bugzilla.wikimedia.org/show_bug.cgi?id=41198

       Web browser: ---
             Bug #: 41198
           Summary: "Invalid argument supplied for foreach" in
                    User::saveOptions() during automatic account creation
           Product: MediaWiki
           Version: 1.21-git
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: User login
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified
   Mobile Platform: ---


Since 1.21wmf2 we are logging "invalid argument supplied for foreach" errors in
User::saveOptions(). Debugging on the live site indicates that this is caused
by interaction between a recent change to CentralAuth (I92f57fc2) a
long-standing bug in User::clearInstanceCache(), and AbuseFilter #18 on
en.wikibooks.org.

User::clearInstanceCache() clears $this->mOptions but does not set
$this->mOptionsLoaded to false, as would be expected for a cache clear. It is
called by addToDatabase(). This is not normally a problem for CentralAuth::
attemptAddUser() since it calls User::loadDefaults() before it calls
addToDatabase(), and loadDefaults() does set $this->mOptionsLoaded to false.

I92f57fc2 rearranged the calling sequence so that the AbortAutoAccount hook is
called in between the loadDefaults() call and the addToDatabase() call. When an
AbortAutoAccount hook function then loads the user options for some reason, the
invalid state is created and User::addToDatabase() generates the warning.

AF #18 on en.wikibooks.org loads the user options when
AbuseFilter::executeFilterActions() calls $wgOut->parseInline(), which
constructs a ParserOptions object.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to