Merge "Ignore height as well as width for framed images."
[lhc/web/wiklou.git] / includes / logging / LogEventsList.php
index ead418d..ad8710c 100644 (file)
@@ -3,7 +3,7 @@
  * Contain classes to list log entries
  *
  * Copyright © 2004 Brion Vibber <brion@pobox.com>, 2008 Aaron Schulz
- * http://www.mediawiki.org/
+ * https://www.mediawiki.org/
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -502,6 +502,7 @@ class LogEventsList extends ContextSource {
         * - wrap String Wrap the message in html (usually something like "<div ...>$1</div>").
         * - flags Integer display flags (NO_ACTION_LINK,NO_EXTRA_USER_LINKS)
         * - useRequestParams boolean Set true to use Pager-related parameters in the WebRequest
+        * - useMaster boolean Use master DB
         * @return int Number of total log items (not limited by $lim)
         */
        public static function showLogExtract(
@@ -515,6 +516,7 @@ class LogEventsList extends ContextSource {
                        'wrap' => "$1",
                        'flags' => 0,
                        'useRequestParams' => false,
+                       'useMaster' => false,
                );
                # The + operator appends elements of remaining keys from the right
                # handed array to the left handed, whereas duplicated keys are NOT overwritten.
@@ -548,6 +550,9 @@ class LogEventsList extends ContextSource {
                        $pager->mIsBackwards = false;
                }
 
+               if ( $param['useMaster'] ) {
+                       $pager->mDb = wfGetDB( DB_MASTER );
+               }
                if ( isset( $param['offset'] ) ) { # Tell pager to ignore WebRequest offset
                        $pager->setOffset( $param['offset'] );
                }