Skip to content

Commit 99daadb

Browse files
author
lkassianik
committed
Phurl URL object should show a banner if the URL is invalid
Summary: Ref T8989, Phurl URL should always show an info banner if the URL isn't valid Test Plan: Phurl objects with URL "google.com" should show an error banner, but objects with URL "http://google.com" should not show banner. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Maniphest Tasks: T8989 Differential Revision: https://secure.phabricator.com/D14386
1 parent 809453a commit 99daadb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/applications/phurl/controller/PhabricatorPhurlURLViewController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ public function handleRequest(AphrontRequest $request) {
3535
$properties = $this->buildPropertyView($url);
3636

3737
$properties->setActionList($actions);
38+
$url_error = id(new PHUIInfoView())
39+
->setErrors(array(pht('This URL is invalid due to a bad protocol.')))
40+
->setIsHidden($url->isValid());
3841
$box = id(new PHUIObjectBoxView())
3942
->setHeader($header)
40-
->addPropertyList($properties);
43+
->addPropertyList($properties)
44+
->setInfoView($url_error);
4145

4246
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
4347
$add_comment_header = $is_serious

0 commit comments

Comments
 (0)