Page MenuHomePhabricator

D14389.diff
No OneTemporary

D14389.diff

diff --git a/src/applications/phurl/editor/PhabricatorPhurlURLEditor.php b/src/applications/phurl/editor/PhabricatorPhurlURLEditor.php
--- a/src/applications/phurl/editor/PhabricatorPhurlURLEditor.php
+++ b/src/applications/phurl/editor/PhabricatorPhurlURLEditor.php
@@ -125,6 +125,21 @@
$error->setIsMissingFieldError(true);
$errors[] = $error;
}
+
+ foreach ($xactions as $xaction) {
+ if ($xaction->getOldValue() != $xaction->getNewValue()) {
+ $protocols = PhabricatorEnv::getEnvConfig('uri.allowed-protocols');
+ $uri = new PhutilURI($xaction->getNewValue());
+ if (!isset($protocols[$uri->getProtocol()])) {
+ $errors[] = new PhabricatorApplicationTransactionValidationError(
+ $type,
+ pht('Invalid URL'),
+ pht('The protocol of the URL is invalid.'),
+ null);
+ }
+ }
+ }
+
break;
}

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 10, 12:46 PM (14 h, 2 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6982701
Default Alt Text
D14389.diff (988 B)

Event Timeline