Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2931861
D25139.1737728871.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25139.1737728871.diff
View Options
diff --git a/src/infrastructure/javelin/markup.php b/src/infrastructure/javelin/markup.php
--- a/src/infrastructure/javelin/markup.php
+++ b/src/infrastructure/javelin/markup.php
@@ -77,9 +77,27 @@
$is_post = (strcasecmp($http_method, 'POST') === 0);
$http_action = idx($attributes, 'action');
- $is_absolute_uri = 0;
- if (phutil_nonempty_string($http_action)) {
+
+ if ($http_action === null) {
+ // Not sure what this is.
+ $is_absolute_uri = false;
+
+ } else if ($http_action instanceof PhutilURI) {
+ // This is the happy path, I think
+
+ // For now, this is close enough - I suspect we'll stay with "https" schema
+ // for the rest of eternity.
+ $protocol = $http_action->getProtocol();
+ $is_absolute_uri = ($protocol == 'http' || $protocol == 'https');
+
+ } else if (is_string($http_action)) {
+ // Also good path?
$is_absolute_uri = preg_match('#^(https?:|//)#', $http_action);
+ } else {
+ throw new Exception(
+ pht(
+ 'Unexpected object type provided as `action` - %s',
+ gettype($http_action)));
}
if ($is_post) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 14:27 (4 d, 8 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1135592
Default Alt Text
D25139.1737728871.diff (1 KB)
Attached To
Mode
D25139: Fix is_absolute test in markup
Attached
Detach File
Event Timeline
Log In to Comment