throw new OAuthException("Listener URI '$listener' not found here");
}
$listenee = $req->get_parameter('omb_listenee');
+ if (!Validate::uri($listenee) &&
+ !common_valid_tag($listenee)) {
+ throw new OAuthException("Listenee URI '$listenee' not a recognizable URI");
+ }
if (strlen($listenee) > 255) {
throw new OAuthException("Listenee URI '$listenee' too long");
}
function common_valid_http_url($url) {
return Validate::uri($url, array('allowed_schemes' => array('http', 'https')));
}
+
+function common_valid_tag($tag) {
+ if (preg_match('/^tag:(.*?),(\d{4}(-\d{2}(-\d{2})?)?):(.*)$/', $tag, $matches)) {
+ return (Validate::email($matches[1]) ||
+ preg_match('/^([\w-\.]+)$/', $matches[1]));
+ }
+ return false;
+}