jenkins-bot has submitted this change and it was merged.

Change subject: bugfixes: use correct data from web request, setup parser
......................................................................


bugfixes: use correct data from web request, setup parser

* SF_AutoeditAPI.php: merge correct data coming from the web request
* SF_AutoeditAPI.php: startExternalParse before actually using the parser

Change-Id: Iaa6142264e302fdbd508281499d65c96a16088ee
---
M includes/SF_AutoeditAPI.php
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Foxtrott: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/SF_AutoeditAPI.php b/includes/SF_AutoeditAPI.php
index 1c2fc83..921986a 100644
--- a/includes/SF_AutoeditAPI.php
+++ b/includes/SF_AutoeditAPI.php
@@ -137,6 +137,13 @@
                }
                $this->mOptions = SFUtils::array_merge_recursive_distinct( 
$data, $this->mOptions );
 
+               global $wgParser, $wgUser;
+               if ( $wgParser === null ) {
+                       $wgParser = new Parser();
+               }
+
+               $wgParser->startExternalParse( null, 
ParserOptions::newFromUser( $wgUser ), Parser::OT_WIKI );
+
                // MW uses the parameter 'title' instead of 'target' when 
submitting
                // data for formedit action => use that
                if ( !array_key_exists( 'target', $this->mOptions ) && 
array_key_exists( 'title', $this->mOptions ) ) {
@@ -323,7 +330,8 @@
                                        'wpEdittime' => '',
                                        'wpEditToken' => $wgUser->isLoggedIn() 
? $wgUser->editToken() : EDIT_TOKEN_SUFFIX,
                                        'action' => 'submit',
-                               ), $this->getRequest()->getValues()
+                               ),
+                               $this->mOptions
                );
 
                if ( array_key_exists( 'format', $data ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/70745
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa6142264e302fdbd508281499d65c96a16088ee
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Foxtrott <[email protected]>
Gerrit-Reviewer: Foxtrott <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to