Last modified: 2013-07-15 10:51:00 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 T53324, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51324 - Provide a (reliable) way to test if a value is in a array (e.g. if a user recently edited a page)
Provide a (reliable) way to test if a value is in a array (e.g. if a user rec...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
AbuseFilter (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-14 16:38 UTC by Helder
Modified: 2013-07-15 10:51 UTC (History)
3 users (show)

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


Attachments
Example (91.21 KB, image/png)
2013-07-14 16:38 UTC, Helder
Details

Description Helder 2013-07-14 16:38:57 UTC
Created attachment 12844 [details]
Example

It is unreliable to test if a user edited a page recently with the code
----------------------------------------
user_name in article_recent_contributors
----------------------------------------
because this will test if the sring in the left is part of the other string (which seems to be a "\n" separated list of usernames, per bug 50107 comment 3).

E.g.: if [[user:example]] is the only one who edited a page, the code above would detect both [[user:example]] and [[user:ample]] as editors of that page. See the screenshot
Comment 1 Helder 2013-07-14 20:21:30 UTC
There seems to be a piece of dead code for this at
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FAbuseFilter.git/HEAD/AbuseFilter.parser.php#L223

	public static function listContains( $value, $list ) {
		// Should use built-in PHP function somehow
		foreach ( $list->data as $item ) {
			if ( self::equals( $value, $item ) ) {
				return true;
			}
		}
		return false;
	}

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


Navigation
Links