getInterwikiLookup(); foreach ( $lookup->getAllPrefixes( null ) as $id => $localPrefixInfo ) { if ( $prefix === $localPrefixInfo['iw_prefix'] ) { return true; } } // @phan-suppress-next-line PhanTypeMismatchArgument global wrongly detected as null $dbr = wfGetDB( DB_REPLICA, [], $wgInterwikiCentralDB ); $res = $dbr->selectRow( 'interwiki', '*', [ 'iw_prefix' => $prefix ], __METHOD__ ); if ( !$res ) { return true; } // Excplicitly make this an array since it's expected to be one $iwData = (array)$res; // At this point, we can safely return false because we know that we have something return false; } elseif ( $isInterlanguageLink && !$shouldSkipILCheck ) { // Global interlanguage link? Whoo! // @phan-suppress-next-line PhanTypeMismatchArgument global wrongly detected as null $dbr = wfGetDB( DB_REPLICA, [], $wgInterwikiCentralInterlanguageDB ); $res = $dbr->selectRow( 'interwiki', '*', [ 'iw_prefix' => $prefix ], __METHOD__ ); if ( !$res ) { return false; } // Excplicitly make this an array since it's expected to be one $iwData = (array)$res; // At this point, we can safely return false because we know that we have something return false; } } }