Index: trunk/extensions/WikiLove/WikiLove.api.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | class WikiLoveApi extends ApiBase { |
4 | 4 | public function execute() { |
5 | | - global $wgRequest, $wgWikiLoveLogging; |
| 5 | + global $wgRequest, $wgWikiLoveLogging, $wgParser; |
6 | 6 | |
7 | 7 | $params = $this->extractRequestParams(); |
8 | 8 | |
— | — | @@ -22,10 +22,9 @@ |
23 | 23 | $api = new ApiMain( new FauxRequest( array( |
24 | 24 | 'action' => 'edit', |
25 | 25 | 'title' => $talk->getFullText(), |
26 | | - 'section' => 'new', |
27 | | - 'text' => $params['text'], |
| 26 | + 'text' => Article::newFromTitle( $talk, new RequestContext() )->replaceSection( 'new', $params['text'], $params['subject'] ), |
28 | 27 | 'token' => $params['token'], |
29 | | - 'summary' => $params['subject'], |
| 28 | + 'summary' => wfMsgForContent( 'wikilove-summary', $wgParser->stripSectionName( $params['subject'] ) ), |
30 | 29 | 'notminor' => true, |
31 | 30 | ), false, array( 'wsEditToken' => $wgRequest->getSessionData( 'wsEditToken' ) ) ), true ); |
32 | 31 | |
Index: trunk/extensions/WikiLove/WikiLove.i18n.php |
— | — | @@ -41,6 +41,7 @@ |
42 | 42 | 'wikilove-err-sig' => 'Please do not include a signature in the message.', |
43 | 43 | 'wikilove-err-gallery' => 'Something went wrong when loading the images!', |
44 | 44 | 'wikilove-err-gallery-again' => 'Try again', |
| 45 | + 'wikilove-summary' => '/* $1 */ new WikiLove message' |
45 | 46 | ); |
46 | 47 | |
47 | 48 | /** Message documentation (Message documentation) |