Last modified: 2014-04-17 11:02:17 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 T65996, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63996 - Block::parseTarget() returns wrong type Block::TYPE_IP instead of correct Block::TYPE_USER
Block::parseTarget() returns wrong type Block::TYPE_IP instead of correct Blo...
Status: UNCONFIRMED
Product: MediaWiki
Classification: Unclassified
User login and signup (Other open bugs)
1.22.5
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-16 11:35 UTC by oliver
Modified: 2014-04-17 11:02 UTC (History)
2 users (show)

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


Attachments
Proposed patch to return correct TYPE_USER (409 bytes, patch)
2014-04-17 10:51 UTC, oliver
Details

Description oliver 2014-04-16 11:35:21 UTC
When an IP address is pased to the function Block::parseTarget(), it creates a new user from it. However, it returns the wrong type Block::TYPE_IP instead of the correct Block::TYPE_USER.

The consequence of this behaviour is that the caller function Block::newLoad() tries to convert the returned value from IP to hex with the IP::toHex() function. This leads to a wrong value returned by getRangeCond(), which then results in a database problem:

2014-04-16 12:46:47 CEST ERROR:  operator does not exist: text <= integer at character 379
2014-04-16 12:46:47 CEST HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
2014-04-16 12:46:47 CEST STATEMENT:  SELECT /* Block::newLoad xxx.yyy.zzz.iii */  ipb_id,ipb_address,ipb_by,ipb_by_text,ipb_reason,ipb_timestamp,ipb_auto,ipb_anon_only,ipb_create_account,ipb_enable_autoblock,ipb_expiry,ipb_deleted,ipb_block_email,ipb_allow_usertalk,ipb_parent_block_id  FROM "ipblocks"   WHERE ipb_address IN ('xxx.yyy.zzz.iii','MyUsername')  OR ((ipb_range_start  LIKE '%' ) AND (ipb_range_start <= 0) AND (ipb_range_end >= 0))
Comment 1 oliver 2014-04-17 10:51:18 UTC
Created attachment 15128 [details]
Proposed patch to return correct TYPE_USER
Comment 2 Andre Klapper 2014-04-17 11:02:17 UTC
Hi! Thanks for your patch!

You are welcome to use Developer access
  https://www.mediawiki.org/wiki/Developer_access
to submit this as a Git branch directly into Gerrit:
  https://www.mediawiki.org/wiki/Git/Tutorial

Putting your branch in Git makes it easier to review it quickly. If you don't want to set up Git/Gerrit, you can also use https://tools.wmflabs.org/gerrit-patch-uploader/  Thanks again!

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


Navigation
Links