X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWikiMap.php;h=37f85ea27c1a6acd9ac712038145914b2d446a1a;hb=685d6dbca432cd0805bc27869deda6efb9dbca6b;hp=cf97984ce17b25ebd5be6cf65860510fc22c89c8;hpb=29906d505b9b3d5f0fd1e6534f077b7fe2c623dc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WikiMap.php b/includes/WikiMap.php index cf97984ce1..37f85ea27c 100644 --- a/includes/WikiMap.php +++ b/includes/WikiMap.php @@ -65,6 +65,14 @@ class WikiMap { $path = $wgConf->get( 'wgArticlePath', $wikiID, $major, [ 'lang' => $minor, 'site' => $major ] ); + + // If we don't have a canonical server or a path containing $1, the + // WikiReference isn't going to function properly. Just return null in + // that case. + if ( !is_string( $canonicalServer ) || !is_string( $path ) || strpos( $path, '$1' ) === false ) { + return null; + } + return new WikiReference( $canonicalServer, $path, $server ); }