@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Validate new Phurl URL

Summary: Closes T9691, Validate URL on Phurl objects for using valid protocols.

Test Plan: Create or edit URL. Change URL to "asdf" and observe error. Change back to "http://google.com" and observe no error.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T9691

Differential Revision: https://secure.phabricator.com/D14389

+15
+15
src/applications/phurl/editor/PhabricatorPhurlURLEditor.php
··· 125 125 $error->setIsMissingFieldError(true); 126 126 $errors[] = $error; 127 127 } 128 + 129 + foreach ($xactions as $xaction) { 130 + if ($xaction->getOldValue() != $xaction->getNewValue()) { 131 + $protocols = PhabricatorEnv::getEnvConfig('uri.allowed-protocols'); 132 + $uri = new PhutilURI($xaction->getNewValue()); 133 + if (!isset($protocols[$uri->getProtocol()])) { 134 + $errors[] = new PhabricatorApplicationTransactionValidationError( 135 + $type, 136 + pht('Invalid URL'), 137 + pht('The protocol of the URL is invalid.'), 138 + null); 139 + } 140 + } 141 + } 142 + 128 143 break; 129 144 } 130 145