Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GA bot handles some signatures incorrectly (fix included) #5

Open
owcz opened this issue Apr 26, 2017 · 1 comment
Open

GA bot handles some signatures incorrectly (fix included) #5

owcz opened this issue Apr 26, 2017 · 1 comment

Comments

@owcz
Copy link

owcz commented Apr 26, 2017

Didn't hear back on talk page, so reposting (all details are below, with a proposed fix by Chris G—just needs to be tested)

https://en.wikipedia.org/wiki/User_talk:Legoktm/March_2017#GA_bot_doesn.27t_count_some_signatures

I recently figured out how to reproduce a long-standing issue with the GA bot in which some editors (including myself) do not receive bot notifs about the review or review counts next to their signatures on WP:GAN. The bot needs to see a "User:" link in the nominator's signature. Currently, signatures with only "User_talk:" links will not receive notifs/counts. Edits like this appear to fix it. Would you be able to tweak the signature detection in the code so that it works with all signatures? (I think it's potentially line 259.) If you're unavailable, is there someone else who can help? czar 20:20, 2 March 2017 (UTC)

It's been years since I've looked at that code. But from what you're describing I think this should do the trick:

<?php
// Line 255
public function setNominator ( $nominator ) {
	$nominator = trim($nominator);
	if (!empty($nominator)) {
		$this->nominator = $nominator;
		preg_match("/\[\[User([ _]talk)?:(.+?)\|.+?\]\]/",$nominator,$m);
		if (!empty($m[2]))
			$this->nominator_plain = trim(ucfirst(str_replace('_',' ',$m[2])));
	}
}

--Chris 13:25, 3 March 2017 (UTC)

@Swpb2
Copy link

Swpb2 commented Dec 7, 2017

This match should also be case insensitive; "user talk" should work as well as "User talk".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants