Merge "Type hint against LinkTarget in WatchedItemStore"
[lhc/web/wiklou.git] / includes / logging / BlockLogFormatter.php
index 84cf0b2..ead290f 100644 (file)
@@ -77,8 +77,8 @@ class BlockLogFormatter extends LogFormatter {
                        // block restrictions
                        if ( isset( $params[6] ) ) {
                                $pages = $params[6]['pages'] ?? [];
-                               $pages = array_map( function ( $page ){
-                                       return $this->makePageLink( Title::newFromText( ( $page ) ) );
+                               $pages = array_map( function ( $page ) {
+                                       return $this->makePageLink( Title::newFromText( $page ) );
                                }, $pages );
 
                                $namespaces = $params[6]['namespaces'] ?? [];
@@ -127,7 +127,7 @@ class BlockLogFormatter extends LogFormatter {
        public function getPreloadTitles() {
                $title = $this->entry->getTarget();
                // Preload user page for non-autoblocks
-               if ( substr( $title->getText(), 0, 1 ) !== '#' ) {
+               if ( substr( $title->getText(), 0, 1 ) !== '#' && $title->isValid() ) {
                        return [ $title->getTalkPage() ];
                }
                return [];