Last modified: 2012-10-29 17:24:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 12769 - Preemptively fix possible weak type-checking errors
Preemptively fix possible weak type-checking errors
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.12.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2008-01-24 03:10 UTC by Aryeh Gregor (not reading bugmail, please e-mail directly)
Modified: 2012-10-29 17:24 UTC (History)
2 users (show)

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


Attachments

Description Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-01-24 03:10:18 UTC
$ grep "\([^\!=]==\|\!=\)\s*''" {includes,skins,languages,maintenance,math,../extensions}/{*,*/*,*/*/*,*/*/*/*}/*.php *.php 2> /dev/null | wc -l
481

That's a lot of == '' and != ''.  These should all be examined and fixed to either check strictly (if that's desired) or, I guess, drop the equality check, since that's more explicit.  Of course, this doesn't count all the cases where you say !$var and assume strong type checking, but there's not much hope for automatically detecting those.  Core looks a little better:

$ grep "\([^\!=]==\|\!=\)\s*''" {includes,skins,languages,maintenance,math}/{*,*/*,*/*/*}/*.php *.php 2> /dev/null | wc -l
27

I'll get on some of these, maybe, if I have the time.
Comment 1 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-01-24 03:41:11 UTC
Of course, my bash globbing was totally off . . .

$ grep "\([^\!=]==\|\!=\)\s*''" {includes,skins,languages,maintenance,math,../extensions}/{,*/,*/*/,*/*/*/}*.php *.php 2> /dev/null | wc -l
748
$ grep "\([^\!=]==\|\!=\)\s*''" {includes,skins,languages,maintenance,math}/{,*/,*/*/,*/*/*/}*.php *.php 2> /dev/null | wc -l
295

That looks less pleasant.
Comment 2 Siebrand Mazeland 2008-04-01 12:34:06 UTC
Score with 1.13alpha (r32654): 790/300 
Comment 3 Antoine "hashar" Musso (WMF) 2008-07-19 13:14:08 UTC
All on one line:
find . -name '*php' -exec grep -H "\([^\!=]==\|\!=\)\s*''" {} \;

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


Navigation
Links