Page MenuHomePhabricator

D21708.id51731.diff
No OneTemporary

D21708.id51731.diff

diff --git a/src/applications/phriction/application/PhabricatorPhrictionApplication.php b/src/applications/phriction/application/PhabricatorPhrictionApplication.php
--- a/src/applications/phriction/application/PhabricatorPhrictionApplication.php
+++ b/src/applications/phriction/application/PhabricatorPhrictionApplication.php
@@ -61,7 +61,7 @@
'new/' => 'PhrictionNewController',
'move/(?P<id>[1-9]\d*)/' => 'PhrictionMoveController',
- 'preview/(?P<slug>.*/)' => 'PhrictionMarkupPreviewController',
+ 'preview/' => 'PhrictionMarkupPreviewController',
'diff/(?P<id>[1-9]\d*)/' => 'PhrictionDiffController',
$this->getEditRoutePattern('document/edit/')
diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php
--- a/src/applications/phriction/controller/PhrictionEditController.php
+++ b/src/applications/phriction/controller/PhrictionEditController.php
@@ -316,9 +316,17 @@
->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
--- a/src/applications/phriction/controller/PhrictionMarkupPreviewController.php
+++ b/src/applications/phriction/controller/PhrictionMarkupPreviewController.php
@@ -8,7 +8,7 @@
$viewer = $request->getUser();
$text = $request->getStr('text');
- $slug = $request->getURIData('slug');
+ $slug = $request->getStr('slug');
$output = PhabricatorMarkupEngine::renderOneObject(
id(new PhabricatorMarkupOneOff())

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 2:31 AM (20 h, 40 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6787777
Default Alt Text
D21708.id51731.diff (2 KB)

Event Timeline