Merge "Maintenance: detect missing parent::__construct()"
[lhc/web/wiklou.git] / includes / logging / PatrolLog.php
index 4fc7637..bb76d5a 100644 (file)
@@ -33,11 +33,18 @@ class PatrolLog {
         *
         * @param $rc Mixed: change identifier or RecentChange object
         * @param $auto Boolean: was this patrol event automatic?
-        * @param $performer User: user performing the action or null to use $wgUser
+        * @param $user User: user performing the action or null to use $wgUser
         *
         * @return bool
         */
        public static function record( $rc, $auto = false, User $user = null ) {
+               global $wgLogAutopatrol;
+
+               // do not log autopatrolled edits if setting disables it
+               if ( $auto && !$wgLogAutopatrol ) {
+                       return false;
+               }
+
                if ( !$rc instanceof RecentChange ) {
                        $rc = RecentChange::newFromId( $rc );
                        if ( !is_object( $rc ) ) {