Last modified: 2011-12-06 15:17:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T34808, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 32808 - NetworkAuth: $u is undefined
NetworkAuth: $u is undefined
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Other (Other open bugs)
unspecified
All All
: Unprioritized minor (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.mediawiki.org/wiki/Extensi...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-05 15:46 UTC by Olaf Lenz
Modified: 2011-12-06 15:17 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch to fix the bug. (445 bytes, patch)
2011-12-05 15:46 UTC, Olaf Lenz
Details
Patch that fixes the broken fix. (1.15 KB, patch)
2011-12-06 14:57 UTC, Olaf Lenz
Details
Patch that fixes the (still) broken fix. (1.15 KB, patch)
2011-12-06 15:12 UTC, Olaf Lenz
Details

Description Olaf Lenz 2011-12-05 15:46:16 UTC
Created attachment 9614 [details]
Patch to fix the bug.

When error reporting is turned on and I use the NetworkAuth extension, I get the following warning:

Notice: Undefined variable: u in (...)/extensions/NetworkAuth/NetworkAuth.php on line 123

As noted on the extensions talk page by user 朝彦 (Asahiko):
  http://www.mediawiki.org/wiki/Extension_talk:NetworkAuth
this is caused by the usage of the function is_null($u) to check whether the variable $u contains something useful. However, when $u is not defined, this causes the warning. The solution is to replace is_null($u) by !isset($u).

I have attached a patch for NetworkAuth.php to solve the problem.
Comment 1 Sam Reed (reedy) 2011-12-05 15:55:37 UTC
Fixed with numerous other issues in r105184
Comment 2 Olaf Lenz 2011-12-06 14:57:10 UTC
Sorry, I have to reopen the bug. The fixes in r105184 have actually really messed up the code, as it changed the logics. I attach a patch that fixes the fix.
Comment 3 Olaf Lenz 2011-12-06 14:57:50 UTC
Created attachment 9622 [details]
Patch that fixes the broken fix.
Comment 4 Sam Reed (reedy) 2011-12-06 14:59:40 UTC
(In reply to comment #2)
> Sorry, I have to reopen the bug. The fixes in r105184 have actually really
> messed up the code, as it changed the logics. I attach a patch that fixes the
> fix.

It was done purposely as it was horrendously written, having empty cases and such, so I inverted the logic to tidy it up somewhat

After the followup in r105185 it's fine
Comment 5 Olaf Lenz 2011-12-06 15:12:10 UTC
Created attachment 9623 [details]
Patch that fixes the (still) broken fix.

Sorry, but no, it's not fine. 
The '!' in front of the User::isUsableName( $u->getName() ) is too much.
My patch furthermore puts all clause into one expression, which makes the whole thing more readble.
Comment 6 Sam Reed (reedy) 2011-12-06 15:17:06 UTC
r105300

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links