summaryrefslogtreecommitdiff
path: root/lib/activityutils.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-21 16:25:12 -0700
committerBrion Vibber <brion@pobox.com>2010-03-21 16:25:12 -0700
commitfcb614d0eb1f98bf8704654ed06e1f9d9733d359 (patch)
tree7c1dcd44885ed262dc92f58b2968ba6182617a54 /lib/activityutils.php
parentb228da628da51337a28ecb1d5f7416717489496c (diff)
Pull <atom:author> info as well as <activity:actor> when we have an old-style ActivityStreams feed. This fixes subscription setup for Cliqset feeds, which currently have a bogus activity:actor/atom:id but a good atom:author/atom:uri
Diffstat (limited to 'lib/activityutils.php')
-rw-r--r--lib/activityutils.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/activityutils.php b/lib/activityutils.php
index c85a3db55..a7e99fb11 100644
--- a/lib/activityutils.php
+++ b/lib/activityutils.php
@@ -240,4 +240,26 @@ class ActivityUtils
throw new ClientException(_("Can't handle embedded Base64 content yet."));
}
}
+
+ /**
+ * Is this a valid URI for remote profile/notice identification?
+ * Does not have to be a resolvable URL.
+ * @param string $uri
+ * @return boolean
+ */
+ static function validateUri($uri)
+ {
+ if (Validate::uri($uri)) {
+ return true;
+ }
+
+ // Possibly an upstream bug; tag: URIs aren't validated properly
+ // unless you explicitly ask for them. All other schemes are accepted
+ // for basic URI validation without asking.
+ if (Validate::uri($uri, array('allowed_scheme' => array('tag')))) {
+ return true;
+ }
+
+ return false;
+ }
}