r105020 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105019‎ | r105020 | r105021 >
Date:22:57, 2 December 2011
Author:gregchiasson
Status:deferred
Tags:
Comment:
Follow up to r105014, do the EmailCapture API call properly.
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php
@@ -115,16 +115,15 @@
116116 }
117117
118118 protected function captureEmail( $email, $json ) {
119 - global $wgScriptPath, $wgServer;
120 - $url = "$wgServer$wgScriptPath/api.php";
121 - $body = "email=$email&info=$json&action=emailcapture&format=json";
122 - $c = curl_init ( $url );
123 - curl_setopt( $c, CURLOPT_POST, true );
124 - curl_setopt( $c, CURLOPT_POSTFIELDS, $body );
125 - curl_setopt( $c, CURLOPT_RETURNTRANSFER, true );
126 -
127 - $rv = curl_exec( $c );
128 - curl_close( $c );
 119+ # http://www.mediawiki.org/wiki/API:Calling_internally
 120+ $params = new FauxRequest( array(
 121+ 'action' => 'emailcapture',
 122+ 'format' => 'json',
 123+ 'email' => $email,
 124+ 'info' => $json
 125+ ) );
 126+ $api = new ApiMain( $params, true );
 127+ $api->execute();
129128 }
130129
131130 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r105014AFTv5 - enable saving email addresses using the EmailCapture extension, same ...gregchiasson22:22, 2 December 2011

Status & tagging log