Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18508897
D18076.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1016 B
Referenced Files
None
Subscribers
None
D18076.id.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D18076: Don't fatal when encountering [[ <bad URI > | ... ]]
Attached
Detach File
Event Timeline
Log In to Comment