X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialRandompage.php;h=9f7ef6690e03846a01a7fba4e31da31b7367d9fc;hb=323a2909ba1f43407ccba8bc1fadf2d25f2de488;hp=73a88b9edc454e4492b94172adb3c5b902504068;hpb=5d318d830323cc69b046b75fafaaa19b78034e9d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialRandompage.php b/includes/specials/SpecialRandompage.php index 73a88b9edc..9f7ef6690e 100644 --- a/includes/specials/SpecialRandompage.php +++ b/includes/specials/SpecialRandompage.php @@ -135,20 +135,26 @@ class RandomPage extends SpecialPage { protected function getQueryInfo( $randstr ) { $redirect = $this->isRedirect() ? 1 : 0; + $tables = array( 'page' ); + $conds = array_merge( array( + 'page_namespace' => $this->namespaces, + 'page_is_redirect' => $redirect, + 'page_random >= ' . $randstr + ), $this->extra ); + $joinConds = array(); + + // Allow extensions to modify the query + Hooks::run( 'RandomPageQuery', array( &$tables, &$conds, &$joinConds ) ); return array( - 'tables' => array( 'page' ), + 'tables' => $tables, 'fields' => array( 'page_title', 'page_namespace' ), - 'conds' => array_merge( array( - 'page_namespace' => $this->namespaces, - 'page_is_redirect' => $redirect, - 'page_random >= ' . $randstr - ), $this->extra ), + 'conds' => $conds, 'options' => array( 'ORDER BY' => 'page_random', 'LIMIT' => 1, ), - 'join_conds' => array() + 'join_conds' => $joinConds ); }