From 20a5aa48b77811ec551d33a6d2921265bf8c1198 Mon Sep 17 00:00:00 2001 From: Catrope Date: Mon, 13 Aug 2012 17:56:30 -0700 Subject: [PATCH] Update API for Parsoid prefix changes The format for wiki prefixes in Parsoid has changed from /mw:Pagename to /mw/Pagename . Update the API module and the config+docs for this change. The default value of the prefix ('localhost') should still work for stock localhost setups. Change-Id: Ic6f3793d175106cc1fae17980d20add63c3f783f --- ApiVisualEditor.php | 9 ++++----- VisualEditor.php | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php index db8178036b..20cc9ecfe0 100644 --- a/ApiVisualEditor.php +++ b/ApiVisualEditor.php @@ -21,11 +21,10 @@ class ApiVisualEditor extends ApiBase { if ( $params['paction'] === 'parse' ) { if ( $page->exists() ) { $parsed = Http::get( - // Insert slash since wgVisualEditorParsoidURL may or may not - // end in a slash. Double slashes are no problem --catrope - $parsoid . '/' . urlencode( - $wgVisualEditorParsoidPrefix . $page->getPrefixedDBkey() - ) + // Insert slash since wgVisualEditorParsoidURL does not + // end in a slash + $parsoid . '/' . $wgVisualEditorParsoidPrefix . '/' . + urlencode( $page->getPrefixedDBkey() ) ); if ( $parsed ) { diff --git a/VisualEditor.php b/VisualEditor.php index f58055c135..25882d92ad 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -11,9 +11,11 @@ /* Configuration */ // URL to the Parsoid instance +// MUST NOT end in a slash due to Parsoid bug $wgVisualEditorParsoidURL = 'http://localhost:8000'; // Interwiki prefix to pass to the Parsoid instance -$wgVisualEditorParsoidPrefix = 'localhost:'; +// Parsoid will be called as $url/$prefix/$pagename +$wgVisualEditorParsoidPrefix = 'localhost'; /* Setup */