jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/344334 )

Change subject: Actually pass the current URL
......................................................................


Actually pass the current URL

Bug: T161017
Change-Id: I307675b2557c25de970f12a1274ba9a9deabe38c
---
M Hooks.php
1 file changed, 12 insertions(+), 1 deletion(-)

Approvals:
  WMDE-Fisch: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Hooks.php b/Hooks.php
index 64cc29c..ad3f03c 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -25,10 +25,21 @@
                        return;
                }
 
+               $parsedUrl = wfParseUrl( $wgFileExporterTarget );
+               $currentUrl = $sktemplate->getTitle()->getFullURL();
+
+               if ( array_key_exists( 'query', $parsedUrl ) ) {
+                       $parsedUrl['query'] .= '&clientUrl=' . urlencode( 
$currentUrl );
+               } else {
+                       $parsedUrl['query'] = 'clientUrl=' . urlencode( 
$currentUrl );
+               }
+
+               $targetUrl = wfAssembleUrl( $parsedUrl );
+
                $links['views']['fileExporter'] = [
                        'class' => '',
                        'text' => Message::newFromKey( 'fileexporter-text' 
)->plain(),
-                       'href' => $wgFileExporterTarget,
+                       'href' => $targetUrl,
                        'target' => '_blank',
                ];
        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I307675b2557c25de970f12a1274ba9a9deabe38c
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/FileExporter
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: WMDE-Fisch <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to