Merge "Exclude redirects from Special:Fewestrevisions"
[lhc/web/wiklou.git] / includes / libs / lockmanager / LockManager.php
index e310768..b8d3ad2 100644 (file)
@@ -4,6 +4,7 @@
  * @ingroup FileBackend
  */
 use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
 use Wikimedia\WaitConditionLoop;
 
 /**
@@ -101,7 +102,7 @@ abstract class LockManager {
                }
                $this->session = md5( implode( '-', $random ) );
 
-               $this->logger = $config['logger'] ?? new \Psr\Log\NullLogger();
+               $this->logger = $config['logger'] ?? new NullLogger();
        }
 
        /**
@@ -201,6 +202,11 @@ abstract class LockManager {
        final protected function normalizePathsByType( array $pathsByType ) {
                $res = [];
                foreach ( $pathsByType as $type => $paths ) {
+                       foreach ( $paths as $path ) {
+                               if ( (string)$path === '' ) {
+                                       throw new InvalidArgumentException( __METHOD__ . ": got empty path." );
+                               }
+                       }
                        $res[$this->lockTypeMap[$type]] = array_unique( $paths );
                }