From: Ævar Arnfjörð Bjarmason Date: Thu, 28 Apr 2005 03:50:52 +0000 (+0000) Subject: * Using isIP(), avoids code duplication. X-Git-Tag: 1.5.0alpha1~92 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=94d76a40f949597c8b196856af171c216d37e8e5;p=lhc%2Fweb%2Fwiklou.git * Using isIP(), avoids code duplication. --- diff --git a/includes/Article.php b/includes/Article.php index 8a9ad87bb9..2012d7fe23 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -80,7 +80,7 @@ class Article { * @return Return the text of this revision */ function getContent( $noredir ) { - global $wgRequest; + global $wgRequest, $wgUser; # Get variables from query string :P $action = $wgRequest->getText( 'action', 'view' ); @@ -100,7 +100,7 @@ class Article { $this->loadContent( $noredir ); # check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page if ( $this->mTitle->getNamespace() == NS_USER_TALK && - preg_match('/^\d{1,3}\.\d{1,3}.\d{1,3}\.\d{1,3}$/',$this->mTitle->getText()) && + $wgUser->isIP($this->mTitle->getText()) && $action=='view' ) { wfProfileOut( $fname );