From db9fc369ca6230cc06ac9102d0d34066e6836cfa Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Tue, 16 Jun 2015 15:33:53 -0700 Subject: [PATCH] Phriction - improve workflow for when user entered slug needs to be normalized. Summary: Encountered this playing with T8402 on my test instance. I think warning the user about adding a trailing "/" is unnecessary so don't do it. I think its confusing to not call out spaces / to lump them in with special characters so call out the sapces. Test Plan: moved a page around and verified no warning if the slug is missing a "/" as user specified and that a change to spaces is called out Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D13316 --- .../phriction/controller/PhrictionMoveController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/applications/phriction/controller/PhrictionMoveController.php b/src/applications/phriction/controller/PhrictionMoveController.php index 21c65f0495..a5febbbaaa 100644 --- a/src/applications/phriction/controller/PhrictionMoveController.php +++ b/src/applications/phriction/controller/PhrictionMoveController.php @@ -36,13 +36,14 @@ final class PhrictionMoveController extends PhrictionController { // about it. if (strlen($v_slug)) { $normal_slug = PhabricatorSlug::normalize($v_slug); - if ($normal_slug !== $v_slug) { + $no_slash_slug = rtrim($normal_slug, '/'); + if ($normal_slug !== $v_slug && $no_slash_slug !== $v_slug) { return $this->newDialog() ->setTitle(pht('Adjust Path')) ->appendParagraph( pht( 'The path you entered (%s) is not a valid wiki document '. - 'path. Paths may not contain special characters.', + 'path. Paths may not contain spaces or special characters.', phutil_tag('strong', array(), $v_slug))) ->appendParagraph( pht(