check that $wgArticle is an instance of the Article class in Skin::pageStats() per...
[lhc/web/wiklou.git] / includes / ExternalStore.php
index 34570e2..d095aba 100644 (file)
@@ -75,7 +75,7 @@ class ExternalStore {
         * @param string $data
         * Returns the URL of the stored data item, or false on error
         */
-       public static function randomInsert( $data ) {
+       public static function insertToDefault( $data ) {
                global $wgDefaultExternalStore;
                $tryStores = (array)$wgDefaultExternalStore;
                $error = false;
@@ -92,12 +92,12 @@ class ExternalStore {
                                $url = $store->store( $params, $data ); // Try to save the object
                        } catch ( DBConnectionError $error ) {
                                $url = false;
-                               unset( $tryStores[$index] ); // Don't try this one again!
-                               $tryStores = array_values( $tryStores ); // Must have consecutive keys
                        }
                        if ( $url ) {
                                return $url; // Done!
                        } else {
+                               unset( $tryStores[$index] ); // Don't try this one again!
+                               $tryStores = array_values( $tryStores ); // Must have consecutive keys
                                wfDebugLog( 'ExternalStorage', "Unable to store text to external storage $storeUrl" );
                        }
                }