Index: trunk/extensions/Drafts/Drafts.hooks.php |
— | — | @@ -221,11 +221,13 @@ |
222 | 222 | } |
223 | 223 | |
224 | 224 | // Respond to ajax queries |
225 | | -function efDraftsSave( $token, $id, $title, $section, $starttime, $edittime, $scrolltop, $text, $summary, $minoredit ) { |
226 | | - global $wgUser; |
| 225 | +function efDraftsSave( $dtoken, $etoken, $id, $title, $section, $starttime, $edittime, $scrolltop, $text, $summary, $minoredit ) { |
| 226 | + global $wgUser, $wgRequest; |
227 | 227 | |
| 228 | + $wgRequest->setVal( 'wpDraftToken', $dtoken ); |
| 229 | + |
228 | 230 | // Verify token |
229 | | - if ( $wgUser->editToken() == $token ) { |
| 231 | + if ( $wgUser->editToken() == $etoken ) { |
230 | 232 | // Create Draft |
231 | 233 | $draft = Draft::newFromID( $id ); |
232 | 234 | |
Index: trunk/extensions/Drafts/Drafts.js |
— | — | @@ -15,6 +15,7 @@ |
16 | 16 | |
17 | 17 | wgAjaxSaveDraft.save = function() { |
18 | 18 | wgAjaxSaveDraft.call( |
| 19 | + document.editform.wpDraftToken.value, |
19 | 20 | document.editform.wpEditToken.value, |
20 | 21 | document.editform.wpDraftID.value, |
21 | 22 | document.editform.wpDraftTitle.value, |
— | — | @@ -84,7 +85,7 @@ |
85 | 86 | } |
86 | 87 | } |
87 | 88 | |
88 | | -wgAjaxSaveDraft.call = function( token, id, title, section, starttime, edittime, scrolltop, text, summary, minoredit ) { |
| 89 | +wgAjaxSaveDraft.call = function( dtoken, etoken, id, title, section, starttime, edittime, scrolltop, text, summary, minoredit ) { |
89 | 90 | // If in progress, exit now |
90 | 91 | if( wgAjaxSaveDraft.inprogress ) |
91 | 92 | return; |
— | — | @@ -95,7 +96,7 @@ |
96 | 97 | // Perform Ajax call |
97 | 98 | sajax_do_call( |
98 | 99 | "efDraftsSave", |
99 | | - [ token, id, title, section, starttime, edittime, scrolltop, text, summary, minoredit ], |
| 100 | + [ dtoken, etoken, id, title, section, starttime, edittime, scrolltop, text, summary, minoredit ], |
100 | 101 | wgAjaxSaveDraft.processResult |
101 | 102 | ); |
102 | 103 | |