Esempio n. 1
0
function wfCheckQC(&$article, &$user, $text, $summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision)
{
    global $wgChangedTemplatesToQC;
    // if an article becomes a redirect, vanquish all previous qc entries
    if (preg_match("@^#REDIRECT@", $text)) {
        QCRule::markAllAsPatrolled($article->getTitle());
        return true;
    }
    // check for bots
    $bots = WikihowUser::getBotIDs();
    if (in_array($user->getID(), $bots)) {
        return true;
    }
    // ignore reverted edits
    if (preg_match("@Reverted edits by@", $summary)) {
        return true;
    }
    // check for intro image change, reverts are ok for this one
    // $l = new QCRuleIntroImage($revision, $article);
    // $l->process();
    // do the templates
    foreach ($wgChangedTemplatesToQC as $t) {
        wfDebug("QC: About to process template change {$t}\n");
        $l = new QCRuleTemplateChange($t, $revision, $article);
        $l->process();
    }
    // check for video changes
    $l = new QCRuleVideoChange($revision, $article);
    $l->process();
    return true;
}