mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RSS
synced 2024-11-30 18:36:08 +00:00
Variable naming
Fix up variable naming in response to some codesniffer issues. Change-Id: Ia0200f265b8f08ae88a84c1dd6f5386b78d750b1
This commit is contained in:
parent
96390e0876
commit
2507b8b367
|
@ -28,10 +28,10 @@ class RSSHooks {
|
||||||
$wgRSSUrlWhitelist,$wgRSSAllowedFeeds;
|
$wgRSSUrlWhitelist,$wgRSSAllowedFeeds;
|
||||||
|
|
||||||
if ( is_array( $wgRSSNamespaces ) && count( $wgRSSNamespaces ) ) {
|
if ( is_array( $wgRSSNamespaces ) && count( $wgRSSNamespaces ) ) {
|
||||||
$ns = $parser->getTitle()->getNamespace();
|
$nsUsed = $parser->getTitle()->getNamespace();
|
||||||
$checkNS = array_flip( $wgRSSNamespaces );
|
$authorizedNamespace = array_flip( $wgRSSNamespaces );
|
||||||
|
|
||||||
if ( !isset( $checkNS[$ns] ) ) {
|
if ( !isset( $authorizedNamespace[$nsUsed] ) ) {
|
||||||
return RSSUtils::getErrorHtml( 'rss-ns-permission' );
|
return RSSUtils::getErrorHtml( 'rss-ns-permission' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,11 +228,11 @@ class RSSParser {
|
||||||
if ( !isset( $this->rss ) ) {
|
if ( !isset( $this->rss ) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$r = $wgMemc->set( $key,
|
$ret = $wgMemc->set( $key,
|
||||||
[ $this->etag, $this->lastModified, $this->rss ],
|
[ $this->etag, $this->lastModified, $this->rss ],
|
||||||
$wgRSSCacheAge );
|
$wgRSSCacheAge );
|
||||||
|
|
||||||
wfDebugLog( 'RSS', "Stored '$key' as in cache? $r" );
|
wfDebugLog( 'RSS', "Stored '$key' as in cache? $ret" );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,9 +251,9 @@ class RSSParser {
|
||||||
$headers['If-None-Match'] = $this->etag;
|
$headers['If-None-Match'] = $this->etag;
|
||||||
}
|
}
|
||||||
if ( $this->lastModified ) {
|
if ( $this->lastModified ) {
|
||||||
$lm = gmdate( 'r', $this->lastModified );
|
$lastModified = gmdate( 'r', $this->lastModified );
|
||||||
wfDebugLog( 'RSS', "Used last modified: $lm" );
|
wfDebugLog( 'RSS', "Used last modified: $lastModified" );
|
||||||
$headers['If-Modified-Since'] = $lm;
|
$headers['If-Modified-Since'] = $lastModified;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -546,16 +546,16 @@ class RSSParser {
|
||||||
$this->storeInCache( $key );
|
$this->storeInCache( $key );
|
||||||
} else {
|
} else {
|
||||||
$this->xml = new DOMDocument;
|
$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' );
|
return Status::newFatal( 'rss-parse-error', 'No XML content' );
|
||||||
}
|
}
|
||||||
|
|
||||||
wfSuppressWarnings();
|
wfSuppressWarnings();
|
||||||
// Prevent loading external entities when parsing the XML (bug 46932)
|
// Prevent loading external entities when parsing the XML (bug 46932)
|
||||||
$oldDisable = libxml_disable_entity_loader( true );
|
$oldDisable = libxml_disable_entity_loader( true );
|
||||||
$this->xml->loadXML( $raw_xml );
|
$this->xml->loadXML( $rawXML );
|
||||||
libxml_disable_entity_loader( $oldDisable );
|
libxml_disable_entity_loader( $oldDisable );
|
||||||
wfRestoreWarnings();
|
wfRestoreWarnings();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue