User "Hashar" posted a comment on MediaWiki.r90219.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90219#c18241
Commit summary:

* (bug 29426) Fix wrong use of Block::load's second parameter in BlockTest

It was accidentally passing a username where it should have passed a user ID, 
causing PostgreSQL's stricter comparisons to fail, while MySQL's allowed it to 
run without complaint but returned bad results.
Of course that bug got hidden by the test.... testing the wrong thing... :)

Now correctly loads using the user id instead of name, checks the proper return 
values, and actually compares the right object.

Comment:

Maybe block::load() should throw an exception if the second parameter ($user) 
is not an integer?

I don't think PHP allow type hinting in functions or we could have wrotten 
something like:

  function /*block -> */ load( string $address = <nowiki>''</nowiki>, int $user 
= 0 ) { .. }
                               ^^^^^^                ^^^

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to