Fix array index for oldid parameter
authorGabriel Wicke <gwicke@wikimedia.org>
Wed, 14 Jan 2015 22:06:01 +0000 (14:06 -0800)
committerGabriel Wicke <gwicke@wikimedia.org>
Wed, 14 Jan 2015 22:06:01 +0000 (14:06 -0800)
This caused an incorrect oldid parameter to be passed to parsoid on html2wt
conversion, resulting in dirty diffs.

Change-Id: If140bbc94f280f9ec5a1c9f6d9c3b4e7a46e1917

includes/libs/virtualrest/ParsoidVirtualRESTService.php

index 34e43f9..03bdf0d 100644 (file)
@@ -88,8 +88,8 @@ class ParsoidVirtualRESTService extends VirtualRESTService {
                                        if ( !isset( $req['body']['html'] ) ) {
                                                throw new Exception( "You must set an 'html' body key for this request" );
                                        }
-                                       if ( isset( $parts[6] ) ) {
-                                               $req['body']['oldid'] = $parts[6];
+                                       if ( isset( $parts[7] ) ) {
+                                               $req['body']['oldid'] = $parts[7];
                                        }
                                } elseif ( $parts[3] == 'wikitext' && $parts[5] == 'html' ) {
                                        if ( !isset( $req['body']['wikitext'] ) ) {