From 61678d8a5d51cc8c09407236d2c42c3cc77f813a Mon Sep 17 00:00:00 2001 From: Nick Jenkins Date: Tue, 23 Jan 2007 07:29:58 +0000 Subject: [PATCH] * Removing a handful of unused globals. * $stack is not modified in Profiler::calltreeCount(), no need to pass-by-ref. * Add FIXME marker to non-cross-platform line. * A freshly created string does not need to be returned by reference. [Xml::namespaceSelector() and HTMLnamespaceselector() ]. --- includes/Parser.php | 2 +- includes/Profiler.php | 2 +- includes/ProtectionForm.php | 2 +- includes/SpecialResetpass.php | 2 +- includes/Wiki.php | 2 +- includes/Xml.php | 2 +- includes/XmlFunctions.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index 8f04aa2935..1d27f906f6 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -722,7 +722,7 @@ class Parser $descriptorspec = array( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), - 2 => array('file', '/dev/null', 'a') + 2 => array('file', '/dev/null', 'a') // FIXME: this line in UNIX-specific, it generates a warning on Windows, because /dev/null is not a valid Windows file. ); $pipes = array(); $process = proc_open("$wgTidyBin -config $wgTidyConf $wgTidyOpts$opts", $descriptorspec, $pipes); diff --git a/includes/Profiler.php b/includes/Profiler.php index 8485edbbd3..8307690ddf 100644 --- a/includes/Profiler.php +++ b/includes/Profiler.php @@ -287,7 +287,7 @@ class Profiler { * @return Integer * @private */ - function calltreeCount(& $stack, $start) { + function calltreeCount($stack, $start) { $level = $stack[$start][1]; $count = 0; for ($i = $start -1; $i >= 0 && $stack[$i][1] > $level; $i --) { diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 56eae6e29d..2d9d31b159 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -28,7 +28,7 @@ class ProtectionForm { var $mExpiry = null; function __construct( &$article ) { - global $wgRequest, $wgUser, $wgLang; + global $wgRequest, $wgUser; global $wgRestrictionTypes, $wgRestrictionLevels; $this->mArticle =& $article; $this->mTitle =& $article->mTitle; diff --git a/includes/SpecialResetpass.php b/includes/SpecialResetpass.php index cde582b1fe..b83375fa21 100644 --- a/includes/SpecialResetpass.php +++ b/includes/SpecialResetpass.php @@ -68,7 +68,7 @@ class PasswordResetForm extends SpecialPage { } function showForm() { - global $wgOut, $wgUser, $wgLang, $wgRequest; + global $wgOut, $wgUser, $wgRequest; $self = SpecialPage::getTitleFor( 'Resetpass' ); $form = diff --git a/includes/Wiki.php b/includes/Wiki.php index cb5cce516c..e5849a1a2f 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -148,7 +148,7 @@ class MediaWiki { { $targetUrl = $title->getFullURL(); // Redirect to canonical url, make it a 301 to allow caching - global $wgServer, $wgUsePathInfo; + global $wgUsePathInfo; if( $targetUrl == $wgRequest->getFullRequestURL() ) { $message = "Redirect loop detected!\n\n" . "This means the wiki got confused about what page was " . diff --git a/includes/Xml.php b/includes/Xml.php index 30b9eacce0..4485626f85 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -69,7 +69,7 @@ class Xml { * @param $includehidden Bool: include hidden namespaces? * @return String: Html string containing the namespace selector */ - public static function &namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false) { + public static function namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false) { global $wgContLang; if( $selected !== '' ) { if( is_null( $selected ) ) { diff --git a/includes/XmlFunctions.php b/includes/XmlFunctions.php index cbdcf5c4b8..326c495325 100644 --- a/includes/XmlFunctions.php +++ b/includes/XmlFunctions.php @@ -15,7 +15,7 @@ function wfOpenElement( $element, $attribs = null ) { function wfCloseElement( $element ) { return ""; } -function &HTMLnamespaceselector($selected = '', $allnamespaces = null, $includehidden=false) { +function HTMLnamespaceselector($selected = '', $allnamespaces = null, $includehidden=false) { return Xml::namespaceSelector( $selected, $allnamespaces, $includehidden ); } function wfSpan( $text, $class, $attribs=array() ) { -- 2.20.1