Merge "Make User::isBot() also check the "bot" right for sanity"
[lhc/web/wiklou.git] / includes / user / User.php
index b1c270f..b5384bc 100644 (file)
@@ -3404,12 +3404,14 @@ class User implements IDBAccessObject {
         * @since 1.28
         */
        public function isBot() {
-               $isBot = false;
-               if ( !Hooks::run( "UserIsBot", [ $this, &$isBot ] ) ) {
-                       return $isBot;
+               if ( in_array( 'bot', $this->getGroups() ) && $this->isAllowed( 'bot' ) ) {
+                       return true;
                }
 
-               return ( $isBot || in_array( 'bot', $this->getGroups() ) );
+               $isBot = false;
+               Hooks::run( "UserIsBot", [ $this, &$isBot ] );
+
+               return $isBot;
        }
 
        /**