Index: trunk/extensions/UsabilityInitiative/ClickTracking/ApiClickTracking.php |
— | — | @@ -60,8 +60,9 @@ |
61 | 61 | if ( !is_null( $params['redirectto'] ) ) { |
62 | 62 | // Validate the redirectto parameter |
63 | 63 | // Must be a local URL, may not be protocol-relative |
| 64 | + // This validation rule is the same as the one in ClickTracking.js |
64 | 65 | $href = $params['redirectto']; |
65 | | - if ( strlen( $href ) > 0 && $href{0} == '/' && ( strlen( $href ) == 1 || $href{1} != '/' ) ) { |
| 66 | + if ( strlen( $href ) > 0 && $href[0] == '/' && ( strlen( $href ) == 1 || $href[1] != '/' ) ) { |
66 | 67 | global $wgOut; |
67 | 68 | $wgOut->redirect( $params['redirectto'] ); |
68 | 69 | $wgOut->output(); |