r68228 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68227‎ | r68228 | r68229 >
Date:18:06, 18 June 2010
Author:catrope
Status:deferred
Tags:
Comment:
Followup to r67278: use [0] not {0} for string indexing per CR. Decided against using strspn() to make the correspondence with the validation rule in JS more obvious
Modified paths:
  • /trunk/extensions/UsabilityInitiative/ClickTracking/ApiClickTracking.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/ClickTracking/ApiClickTracking.php
@@ -60,8 +60,9 @@
6161 if ( !is_null( $params['redirectto'] ) ) {
6262 // Validate the redirectto parameter
6363 // Must be a local URL, may not be protocol-relative
 64+ // This validation rule is the same as the one in ClickTracking.js
6465 $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] != '/' ) ) {
6667 global $wgOut;
6768 $wgOut->redirect( $params['redirectto'] );
6869 $wgOut->output();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r67278Fixed for r58099 per CR:...catrope09:53, 3 June 2010

Status & tagging log