Merge "HTML escape parameter 'text' of hook 'SkinEditSectionLinks'"
[lhc/web/wiklou.git] / includes / cache / CacheHelper.php
index d7669eb..d798ddb 100644 (file)
@@ -221,13 +221,11 @@ class CacheHelper implements ICacheHelper {
                                } else {
                                        $value = array_shift( $this->cachedChunks );
                                }
+                       } elseif ( array_key_exists( $key, $this->cachedChunks ) ) {
+                               $value = $this->cachedChunks[$key];
+                               unset( $this->cachedChunks[$key] );
                        } else {
-                               if ( array_key_exists( $key, $this->cachedChunks ) ) {
-                                       $value = $this->cachedChunks[$key];
-                                       unset( $this->cachedChunks[$key] );
-                               } else {
-                                       wfWarn( "There is no item with key '$key' in this->cachedChunks in " . __METHOD__ );
-                               }
+                               wfWarn( "There is no item with key '$key' in this->cachedChunks in " . __METHOD__ );
                        }
                } else {
                        if ( !is_array( $args ) ) {
@@ -290,7 +288,9 @@ class CacheHelper implements ICacheHelper {
                        throw new MWException( 'No cache key set, so cannot obtain or save the CacheHelper values.' );
                }
 
-               return wfMemcKey( ...array_values( $this->cacheKey ) );
+               return ObjectCache::getLocalClusterInstance()->makeKey(
+                       ...array_values( $this->cacheKey )
+               );
        }
 
        /**