r95865 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95864‎ | r95865 | r95866 >
Date:13:48, 31 August 2011
Author:nikerabbit
Status:resolved (Comments)
Tags:
Comment:
Protocal relative url fixes to Translate extension
Modified paths:
  • /trunk/extensions/Translate/ffs/Gettext.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/ffs/Gettext.php
@@ -313,6 +313,8 @@
314314
315315 protected function doGettextHeader( MessageCollection $collection, $template, &$pluralCount ) {
316316 global $wgSitename, $wgServer;
 317+
 318+ $server = wfExpandUrl( $wgServer, PROTO_CANONICAL );
317319 $code = $collection->code;
318320 $name = TranslateUtils::getLanguageName( $code );
319321 $native = TranslateUtils::getLanguageName( $code, true );
@@ -334,7 +336,7 @@
335337 $output = trim( $output ) . "\n";
336338
337339 // @todo twn specific
338 - $portal = Title::makeTitle( NS_PORTAL, $code )->getFullUrl();
 340+ $portal = Title::makeTitle( NS_PORTAL, $code )->getCanonicalUrl();
339341
340342 $specs = isset( $template['HEADERS'] ) ? $template['HEADERS'] : array();
341343
@@ -351,7 +353,7 @@
352354 $specs['Content-Type'] = 'text/plain; charset=UTF-8';
353355 $specs['Content-Transfer-Encoding'] = '8bit';
354356 $specs['X-Generator'] = $this->getGenerator();
355 - $specs['X-Translation-Project'] = "$wgSitename at $wgServer";
 357+ $specs['X-Translation-Project'] = "$wgSitename at $server";
356358 $specs['X-Language-Code'] = $code;
357359 if ( $this->offlineMode ) {
358360 $specs['X-Message-Group'] = $this->group->getId();

Follow-up revisions

RevisionCommit summaryAuthorDate
r95869Improve on r95865 as suggested by Roannikerabbit14:34, 31 August 2011

Comments

#Comment by Catrope (talk | contribs)   13:56, 31 August 2011
+		$server = wfExpandUrl( $wgServer, PROTO_CANONICAL );

You probably want to use $wgCanonicalServer directly. PROTO_CANONICAL uses that anyway.

Status & tagging log