Page MenuHomePhabricator

D18076.id.diff
No OneTemporary

D18076.id.diff

diff --git a/src/markup/engine/remarkup/markuprule/PhutilRemarkupDocumentLinkRule.php b/src/markup/engine/remarkup/markuprule/PhutilRemarkupDocumentLinkRule.php
--- a/src/markup/engine/remarkup/markuprule/PhutilRemarkupDocumentLinkRule.php
+++ b/src/markup/engine/remarkup/markuprule/PhutilRemarkupDocumentLinkRule.php
@@ -120,9 +120,16 @@
$protocols = $this->getEngine()->getConfig(
'uri.allowed-protocols',
array());
- $protocol = id(new PhutilURI($uri))->getProtocol();
- if (!idx($protocols, $protocol)) {
- // Don't treat this as a URI if it's not an allowed protocol.
+
+ try {
+ $protocol = id(new PhutilURI($uri))->getProtocol();
+ if (!idx($protocols, $protocol)) {
+ // Don't treat this as a URI if it's not an allowed protocol.
+ $is_uri = false;
+ }
+ } catch (Exception $ex) {
+ // We can end up here if we try to parse an ambiguous URI, see
+ // T12796.
$is_uri = false;
}
}

File Metadata

Mime Type
text/plain
Expires
Sep 6 2025, 3:05 AM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8748303
Default Alt Text
D18076.id.diff (1016 B)

Event Timeline