mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RSS
synced 2024-11-11 16:59:16 +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;
|
||||
|
||||
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' );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue