From 2507b8b3676837a44b369a404de74920cacd7aba Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Tue, 8 Jan 2019 12:35:47 -0500 Subject: [PATCH] Variable naming Fix up variable naming in response to some codesniffer issues. Change-Id: Ia0200f265b8f08ae88a84c1dd6f5386b78d750b1 --- RSSHooks.php | 6 +++--- RSSParser.php | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/RSSHooks.php b/RSSHooks.php index 45576ce..bdeecaa 100644 --- a/RSSHooks.php +++ b/RSSHooks.php @@ -28,10 +28,10 @@ class RSSHooks { $wgRSSUrlWhitelist,$wgRSSAllowedFeeds; if ( is_array( $wgRSSNamespaces ) && count( $wgRSSNamespaces ) ) { - $ns = $parser->getTitle()->getNamespace(); - $checkNS = array_flip( $wgRSSNamespaces ); + $nsUsed = $parser->getTitle()->getNamespace(); + $authorizedNamespace = array_flip( $wgRSSNamespaces ); - if ( !isset( $checkNS[$ns] ) ) { + if ( !isset( $authorizedNamespace[$nsUsed] ) ) { return RSSUtils::getErrorHtml( 'rss-ns-permission' ); } } diff --git a/RSSParser.php b/RSSParser.php index be11d52..8413f1a 100644 --- a/RSSParser.php +++ b/RSSParser.php @@ -228,11 +228,11 @@ class RSSParser { if ( !isset( $this->rss ) ) { return false; } - $r = $wgMemc->set( $key, + $ret = $wgMemc->set( $key, [ $this->etag, $this->lastModified, $this->rss ], $wgRSSCacheAge ); - wfDebugLog( 'RSS', "Stored '$key' as in cache? $r" ); + wfDebugLog( 'RSS', "Stored '$key' as in cache? $ret" ); return true; } @@ -251,9 +251,9 @@ class RSSParser { $headers['If-None-Match'] = $this->etag; } if ( $this->lastModified ) { - $lm = gmdate( 'r', $this->lastModified ); - wfDebugLog( 'RSS', "Used last modified: $lm" ); - $headers['If-Modified-Since'] = $lm; + $lastModified = gmdate( 'r', $this->lastModified ); + wfDebugLog( 'RSS', "Used last modified: $lastModified" ); + $headers['If-Modified-Since'] = $lastModified; } /** @@ -546,16 +546,16 @@ class RSSParser { $this->storeInCache( $key ); } else { $this->xml = new DOMDocument; - $raw_xml = $this->client->getContent(); + $rawXML = $this->client->getContent(); - if ( $raw_xml == '' ) { + if ( $rawXML == '' ) { return Status::newFatal( 'rss-parse-error', 'No XML content' ); } wfSuppressWarnings(); // Prevent loading external entities when parsing the XML (bug 46932) $oldDisable = libxml_disable_entity_loader( true ); - $this->xml->loadXML( $raw_xml ); + $this->xml->loadXML( $rawXML ); libxml_disable_entity_loader( $oldDisable ); wfRestoreWarnings();