SECURITY: Disallow loading JS/CSS/Json subpages from unregistered users and log
[lhc/web/wiklou.git] / includes / Autopromote.php
index 56fbb07..a01465e 100644 (file)
@@ -177,7 +177,13 @@ class Autopromote {
                                }
                                return false;
                        case APCOND_EDITCOUNT:
-                               return $user->getEditCount() >= $cond[1];
+                               $reqEditCount = $cond[1];
+
+                               // T157718: Avoid edit count lookup if specified edit count is 0 or invalid
+                               if ( $reqEditCount <= 0 ) {
+                                       return true;
+                               }
+                               return $user->getEditCount() >= $reqEditCount;
                        case APCOND_AGE:
                                $age = time() - wfTimestampOrNull( TS_UNIX, $user->getRegistration() );
                                return $age >= $cond[1];