Index: trunk/extensions/ClickTracking/ApiClickTracking.php |
— | — | @@ -61,21 +61,14 @@ |
62 | 62 | // For links that go off the page, redirect the user |
63 | 63 | // FIXME: The API should have a proper infrastructure for this |
64 | 64 | 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 |
68 | 65 | $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(); |
73 | 69 | |
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(); |
80 | 73 | } |
81 | 74 | } |
82 | 75 | |