diff --git a/src/applications/phriction/application/PhabricatorPhrictionApplication.php b/src/applications/phriction/application/PhabricatorPhrictionApplication.php index 02f285aef3..edb035a63b 100644 --- a/src/applications/phriction/application/PhabricatorPhrictionApplication.php +++ b/src/applications/phriction/application/PhabricatorPhrictionApplication.php @@ -61,7 +61,7 @@ final class PhabricatorPhrictionApplication extends PhabricatorApplication { 'new/' => 'PhrictionNewController', 'move/(?P[1-9]\d*)/' => 'PhrictionMoveController', - 'preview/(?P.*/)' => 'PhrictionMarkupPreviewController', + 'preview/' => 'PhrictionMarkupPreviewController', 'diff/(?P[1-9]\d*)/' => 'PhrictionDiffController', $this->getEditRoutePattern('document/edit/') diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php index d86fa1e05b..e6dea7f0ad 100644 --- a/src/applications/phriction/controller/PhrictionEditController.php +++ b/src/applications/phriction/controller/PhrictionEditController.php @@ -316,9 +316,17 @@ final class PhrictionEditController ->setBackground(PHUIObjectBoxView::WHITE_CONFIG) ->setForm($form); + $preview_uri = '/phriction/preview/'; + $preview_uri = new PhutilURI( + $preview_uri, + array( + 'slug' => $document->getSlug(), + )); + $preview_uri = phutil_string_cast($preview_uri); + $preview = id(new PHUIRemarkupPreviewPanel()) ->setHeader($content->getTitle()) - ->setPreviewURI('/phriction/preview/'.$document->getSlug()) + ->setPreviewURI($preview_uri) ->setControlID('document-textarea') ->setPreviewType(PHUIRemarkupPreviewPanel::DOCUMENT); diff --git a/src/applications/phriction/controller/PhrictionMarkupPreviewController.php b/src/applications/phriction/controller/PhrictionMarkupPreviewController.php index b5c97e5c64..7e56436dbb 100644 --- a/src/applications/phriction/controller/PhrictionMarkupPreviewController.php +++ b/src/applications/phriction/controller/PhrictionMarkupPreviewController.php @@ -8,7 +8,7 @@ final class PhrictionMarkupPreviewController $viewer = $request->getUser(); $text = $request->getStr('text'); - $slug = $request->getURIData('slug'); + $slug = $request->getStr('slug'); $output = PhabricatorMarkupEngine::renderOneObject( id(new PhabricatorMarkupOneOff())