From efbfbd44a4b88b1007dc1c0452330c811c960b3b Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 6 May 2008 11:59:58 +0000 Subject: [PATCH] Don't call preg_replace ~80 times per request. Leave the heavy lifting to Special:Version, using the new svn-revision member of $wgExtensionCredits. --- Cite.php | 3 ++- SpecialCite.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cite.php b/Cite.php index 7f337653..8dedffee 100644 --- a/Cite.php +++ b/Cite.php @@ -21,7 +21,8 @@ if ( ! defined( 'MEDIAWIKI' ) ) $wgExtensionFunctions[] = 'wfCite'; $wgExtensionCredits['parserhook'][] = array( 'name' => 'Cite', - 'version' => preg_replace('/^.* (\d\d\d\d-\d\d-\d\d) .*$/', '\1', '$LastChangedDate$'), #just the date of the last change + 'svn-date' => '$LastChangedDate$', + 'svn-revision' => '$LastChangedRevision$', 'author' => 'Ævar Arnfjörð Bjarmason', 'description' => 'Adds and tags, for citations', // kept for b/c 'descriptionmsg' => 'cite_desc', diff --git a/SpecialCite.php b/SpecialCite.php index d01d65d3..b323bee6 100644 --- a/SpecialCite.php +++ b/SpecialCite.php @@ -15,7 +15,8 @@ if (!defined('MEDIAWIKI')) die(); $wgExtensionCredits['specialpage'][] = array( 'name' => 'Cite', - 'version' => preg_replace('/^.* (\d\d\d\d-\d\d-\d\d) .*$/', '\1', '$LastChangedDate$'), #just the date of the last change + 'svn-date' => '$LastChangedDate$', + 'svn-revision' => '$LastChangedRevision$', 'author' => 'Ævar Arnfjörð Bjarmason', 'description' => 'adds a [[Special:Cite|citation]] special page & toolbox link', // kept for b/c 'descriptionmsg' => 'cite_article_desc',