r64385 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64384‎ | r64385 | r64386 >
Date:10:38, 30 March 2010
Author:demon
Status:resolved (Comments)
Tags:
Comment:
Cleanup r60758, use strpos() when looking for a simple string, no need for preg_match()
Modified paths:
  • /trunk/extensions/GeoLite/GeoLite_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GeoLite/GeoLite_body.php
@@ -51,7 +51,7 @@
5252 public function getDestination( $utm_source ) {
5353 global $wgChaptersPageBase, $wgAppealPageBase;
5454
55 - $dest = ( preg_match( '/Jimmy_Appeal/', $utm_source ) ) ? $wgAppealPageBase : $wgChaptersPageBase;
 55+ $dest = ( strpos( $utm_source, 'Jimmy_Appeal' ) !== false ) ? $wgAppealPageBase : $wgChaptersPageBase;
5656
5757 return $dest;
5858 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60758fix for r60096. simplifying match since preg_match() is cheap to runtomasz01:10, 7 January 2010

Comments

#Comment by Tim Starling (talk | contribs)   00:23, 7 July 2010

The regex was meant to be anchored, see the code it was replacing in r60096. I think /^[^\/]*\/Jimmy_Appeal/ is probably what was intended, Tomasz can confirm.

#Comment by 😂 (talk | contribs)   18:58, 8 December 2010

Marking this resolved since this extension has been obsoleted by LandingCheck.

Status & tagging log