Skip to content

Commit

Permalink
Merge pull request Majr25#2 from noahm/fix-wildcards
Browse files Browse the repository at this point in the history
Restore wildcard patterns
  • Loading branch information
Matt Russell authored and Matt Russell committed Apr 30, 2015
2 parents e52342b + 9591abb commit 52fa849
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ExcludeRandom.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@

function wfExcludeRandomInit( &$rand, &$isRedir, &$namespaces, &$extra, &$title ) {
global $wgExcludeRandomPages;
$DB = wfGetDB(DB_MASTER);
if (!$wgExcludeRandomPages) {
return true;
}


$DB = wfGetDB(DB_MASTER);
foreach ($wgExcludeRandomPages AS $cond) {
$extra[] = "`page_title` NOT LIKE '".$DB->strencode($cond)."'";
$pattern = $DB->strencode($cond);
$pattern = str_replace( array(' ', '*', '%'),
array('_', '%', '\%'), $pattern);
$extra[] = "`page_title` NOT LIKE '$pattern'";
}

return true;
}
?>

0 comments on commit 52fa849

Please sign in to comment.