r98305 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98304‎ | r98305 | r98306 >
Date:13:09, 28 September 2011
Author:catrope
Status:old
Tags:
Comment:
1.17wmf1: Dirty, dirty hack to force API action=parse to generate absolute URLs. This is needed to circumvent a bug in iOS apps while the app developers work on a fix (see http://lists.wikimedia.org/pipermail/mediawiki-api/2011-September/002361.html ) and will be reverted in a few weeks when the apps are fixed.
Modified paths:
  • /branches/wmf/1.17wmf1/includes/Title.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/parser/ParserCache.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/includes/parser/ParserCache.php
@@ -42,7 +42,7 @@
4343
4444 // idhash seem to mean 'page id' + 'rendering hash' (r3710)
4545 $pageid = $article->getID();
46 - $renderkey = (int)($wgRequest->getVal('action') == 'render');
 46+ $renderkey = (int)($wgRequest->getVal('action') == 'render') + 2*(int)($wgRequest->getVal('action') == 'parse');
4747
4848 $key = wfMemcKey( 'pcache', 'idhash', "{$pageid}-{$renderkey}!{$hash}" );
4949 return $key;
Index: branches/wmf/1.17wmf1/includes/Title.php
@@ -918,6 +918,12 @@
919919 if ( $wgRequest->getVal( 'action' ) == 'render' ) {
920920 $url = $wgServer . $url;
921921 }
 922+
 923+ // HACK for iOS issue: expand URLs to absolute in API action=parse
 924+ // See http://lists.wikimedia.org/pipermail/mediawiki-api/2011-September/002361.html for details
 925+ if ( $wgRequest->getVal( 'action' ) == 'parse' ) {
 926+ $url = wfExpandUrl( $url, PROTO_CANONICAL );
 927+ }
922928 }
923929 wfRunHooks( 'GetLocalURL', array( &$this, &$url, $query ) );
924930 return $url;

Follow-up revisions

RevisionCommit summaryAuthorDate
r983061.18wmf1: Merge 98305 from 1.17wmf1catrope13:22, 28 September 2011
r98308Followup r98305: fix borked URLs with double server names due to an extra act...catrope13:40, 28 September 2011
r983101.17wmf1: Followup r98305, r98308, bump to 4 because I've been trying stuff o...catrope13:49, 28 September 2011
r997161.17wmf1: Revert r98305, r98308, r98310, r98930 (action=parse iOS hack)catrope18:49, 13 October 2011

Status & tagging log