Variable naming

Fix up variable naming in response to some codesniffer issues.

Change-Id: Ia0200f265b8f08ae88a84c1dd6f5386b78d750b1
This commit is contained in:
Mark A. Hershberger 2019-01-08 12:35:47 -05:00
parent 96390e0876
commit 2507b8b367
No known key found for this signature in database
GPG key ID: 7956EE477F901A30
2 changed files with 11 additions and 11 deletions

View file

@ -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' );
}
}

View file

@ -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();