r106679 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106678‎ | r106679 | r106680 >
Date:20:04, 19 December 2011
Author:catrope
Status:ok
Tags:
Comment:
Remove server-side "validation" of redirect URLs, not needed and getting in the way for AFTv5
Modified paths:
  • /trunk/extensions/ClickTracking/ApiClickTracking.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ClickTracking/ApiClickTracking.php
@@ -61,21 +61,14 @@
6262 // For links that go off the page, redirect the user
6363 // FIXME: The API should have a proper infrastructure for this
6464 if ( !is_null( $params['redirectto'] ) ) {
65 - // Validate the redirectto parameter
66 - // Must be a local URL, may not be protocol-relative
67 - // This validation rule is the same as the one in ClickTracking.js
6865 $href = $params['redirectto'];
69 - if ( strlen( $href ) > 0 && $href[0] == '/' && ( strlen( $href ) == 1 || $href[1] != '/' ) ) {
70 - global $wgOut;
71 - $wgOut->redirect( $params['redirectto'] );
72 - $wgOut->output();
 66+ global $wgOut;
 67+ $wgOut->redirect( $params['redirectto'] );
 68+ $wgOut->output();
7369
74 - // Prevent any further output
75 - $wgOut->disable();
76 - $this->getMain()->getPrinter()->disable();
77 - } else {
78 - $this->dieUsage( 'The URL to redirect to must be domain-relative, i.e. start with a /', 'badurl' );
79 - }
 70+ // Prevent any further output
 71+ $wgOut->disable();
 72+ $this->getMain()->getPrinter()->disable();
8073 }
8174 }
8275

Follow-up revisions

RevisionCommit summaryAuthorDate
r1066811.18wmf1: MFT r106679catrope20:09, 19 December 2011

Status & tagging log