From 94d76a40f949597c8b196856af171c216d37e8e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 28 Apr 2005 03:50:52 +0000 Subject: [PATCH] * Using isIP(), avoids code duplication. --- includes/Article.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ); -- 2.20.1