Skip to content

Commit

Permalink
Merge pull request #574 from GlazerMann/patch-5
Browse files Browse the repository at this point in the history
Fixes #573 : Don't add[[WP:UCB|Assisted by Citation bot]] twice.
  • Loading branch information
Martin R. Smith committed Aug 16, 2018
2 parents b172666 + ae180cf commit 78a5d7f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gadgetapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
$page->expand_text();

//Modify edit summary to identify bot-assisted edits
if ($editSummary) {
$editSummary .= " | ";
$UCB_Assisted = "[[WP:UCB|Assisted by Citation bot]]";
if (mb_substr(trim($editSummary),-mb_strlen($UCB_Assisted)) !== $UCB_Assisted ){
if ($editSummary) {
$editSummary .= " | ";
}
$editSummary .= $UCB_Assisted;
}
$editSummary .= "[[WP:UCB|Assisted by Citation bot]]";

if (isset($_REQUEST['debug']) && $_REQUEST['debug']==='1') {
$debug_text = ob_get_contents();
Expand Down

0 comments on commit 78a5d7f

Please sign in to comment.