Fix remote page detection logic

Remote pages can be global user pages, etc., not restricted to files on Commons.

Change-Id: I89368c93e25ca970bf35ad742a1054473b6d6c48
This commit is contained in:
Dringsim 2023-08-22 17:13:09 +08:00
parent c0176c9a12
commit 90ccc475df
No known key found for this signature in database
GPG key ID: 7C5B1DFB8E73902C

View file

@ -551,8 +551,7 @@ class Hooks implements TextSlotDiffRendererTablePrefixHook {
// us to splice into the middle of an associative array.
$newViews = [];
$wikiPageFactory = $services->getWikiPageFactory();
$isRemote = $title->inNamespace( NS_FILE ) &&
!$wikiPageFactory->newFromTitle( $title )->isLocal();
$isRemote = !$wikiPageFactory->newFromTitle( $title )->isLocal();
foreach ( $links['views'] as $action => $data ) {
if ( $action === 'edit' ) {
// Build the VisualEditor tab