Revision: 50069
Author:   tstarling
Date:     2009-04-30 06:00:01 +0000 (Thu, 30 Apr 2009)

Log Message:
-----------
Small-scale data loss logged on Wikimedia along these lines: invalid URL 
written to old_text with the user thinking their edit has succeeded. This 
change should prevent that scenario.

Modified Paths:
--------------
    trunk/phase3/includes/ExternalStoreDB.php

Modified: trunk/phase3/includes/ExternalStoreDB.php
===================================================================
--- trunk/phase3/includes/ExternalStoreDB.php   2009-04-30 05:52:25 UTC (rev 
50068)
+++ trunk/phase3/includes/ExternalStoreDB.php   2009-04-30 06:00:01 UTC (rev 
50069)
@@ -136,6 +136,9 @@
                        array( 'blob_id' => $id, 'blob_text' => $data ), 
                        __METHOD__ );
                $id = $dbw->insertId();
+               if ( !$id ) {
+                       throw new MWException( __METHOD__.': no insert ID' );
+               }
                if ( $dbw->getFlag( DBO_TRX ) ) {
                        $dbw->immediateCommit();
                }



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to