Permalink
Browse files

Don't include OPs vote

What: Don't include OPs vote even if they forget to sign the RFC itself, if they did include a section header.

How: After we've got the timestamp, this should correct the description if it included any section headers by truncating from the header on.  This will make it less likely that the OPs vote will be included.
See https://en.wikipedia.org/wiki/User_talk:Legobot#Legobot_bug_-_votes_included_even_when_separated_by_a_section_mark.

WARNING: This is UNTESTED, and I'd be pleasantly surprised if it works well as is. MediaWiki code newbie.  Consider this little more than a pseudocode suggestion.  

If the RFC itself includes sections, this will truncate prematurely, but that may not be a bad thing, the RFC is probably too long.
  • Loading branch information...
elvey committed Jun 4, 2014
1 parent c0843a7 commit 38562b97a4ae7d2e1807e208133c9d45a5a8101c
Showing with 1 addition and 0 deletions.
  1. +1 −0 rfcbot.php
View
@@ -208,6 +208,7 @@ function generateRfcId ($tries=0) {
$description = "{{rfcquote|text=\n" . $description . "}}"; // indents the description
preg_match("/([0-2]\d):([0-5]\d),\s(\d{1,2})\s(\w*)\s(\d{4})\s\(UTC\)/i", $description, $t);
$timestamp = strtotime($t[0]);
$description = preg_replace("'''\n\n.*", "", $description); // truncate at start of section header
} else {
$description = $prettytimestamp;
}

0 comments on commit 38562b9

Please sign in to comment.