"Johnduhart" posted a comment on MediaWiki.r105014.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/105014#c26881
Commit summary for MediaWiki.r105014:
AFTv5 - enable saving email addresses using the EmailCapture extension, same
way v4 did it. Sort of think this should be it's own input and be stored in
aft_article_answer, but for now let's keep it the same, I guess.
Johnduhart's comment:
<pre>+ protected function captureEmail( $email, $json ) {
+ global $wgScriptPath, $wgServer;
+ $url = "$wgServer$wgScriptPath/api.php";
+ $body =
"email=$email&info=$json&action=emailcapture&format=json";
+ $c = curl_init ( $url );
+ curl_setopt( $c, CURLOPT_POST, true );
+ curl_setopt( $c, CURLOPT_POSTFIELDS, $body );
+ curl_setopt( $c, CURLOPT_RETURNTRANSFER, true );
+
+ $rv = curl_exec( $c );
+ curl_close( $c );
+ }
+</pre>
Use the internal API, not HTTP requests....
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview