Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/344331 )

Change subject: Only show link for local files
......................................................................

Only show link for local files

Bug: T161126
Change-Id: I7c8ba2a43cee4b54fa5026fcbb945c7e3fd3c8af
---
M Hooks.php
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FileExporter 
refs/changes/31/344331/1

diff --git a/Hooks.php b/Hooks.php
index 95b444e..64cc29c 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -4,6 +4,7 @@
 
 use Message;
 use SkinTemplate;
+use WikiFilePage;
 
 /**
  * @author Addshore
@@ -13,8 +14,12 @@
        public static function onSkinTemplateNavigation( SkinTemplate 
&$sktemplate, array &$links ) {
                global $wgFileExporterTarget;
 
+               $title = $sktemplate->getTitle();
+               $page = new WikiFilePage( $title );
+
                if (
-                       $sktemplate->getTitle()->getNamespace() !== NS_FILE ||
+                       $title->getNamespace() !== NS_FILE ||
+                       !$page->isLocal() ||
                        $sktemplate->getUser()->isNewbie()
                ) {
                        return;

-- 
To view, visit https://gerrit.wikimedia.org/r/344331
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c8ba2a43cee4b54fa5026fcbb945c7e3fd3c8af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FileExporter
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to