r76643 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76642‎ | r76643 | r76644 >
Date:19:16, 13 November 2010
Author:catrope
Status:ok
Tags:
Comment:
RSS extension:
* Prefix memcached keys with 'rss'
* Check is_array() rather than != null before using list() on the cache entry
* Fix language in comment
Modified paths:
  • /trunk/extensions/RSS/RSSParser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RSS/RSSParser.php
@@ -111,7 +111,7 @@
112112 // 2. if there is a hit, make sure its fresh
113113 // 3. if cached obj fails freshness check, fetch remote
114114 // 4. if remote fails, return stale object, or error
115 - $key = wfMemcKey( $this->url );
 115+ $key = wfMemcKey( 'rss', $this->url );
116116 $cachedFeed = $this->loadFromCache( $key );
117117 if ( $cachedFeed !== false ) {
118118 wfDebugLog( 'RSS', 'Outputting cached feed for ' . $this->url );
@@ -132,7 +132,7 @@
133133 global $wgMemc, $wgRSSCacheCompare;
134134
135135 $data = $wgMemc->get( $key );
136 - if ( $data === false ) {
 136+ if ( !is_array( $data ) ) {
137137 return false;
138138 }
139139
@@ -160,7 +160,7 @@
161161 }
162162
163163 /**
164 - * Store this objects (e.g. etag, lastModified, and RSS) in the cache.
 164+ * Store these objects (i.e. etag, lastModified, and RSS) in the cache.
165165 * @param $key String: lookup key to associate with this item
166166 * @return boolean
167167 */

Status & tagging log