]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/actions/pushhub.php
Debugging log fix.
[quix0rs-gnu-social.git] / plugins / OStatus / actions / pushhub.php
index 8f54a1497b15995fb9a2f200e0c03ecdd6777ef0..6dc22706c3e55746d58df09b0aea01123b9c1567 100644 (file)
@@ -118,7 +118,6 @@ class PushHubAction extends Action
                 $sub->secret = $secret;
             }
             if ($lease) {
-                common_debug('PuSH hub setting dataobject lease to:'._ve(intval($lease)));
                 $sub->setLease(intval($lease));
             }
         }
@@ -200,7 +199,7 @@ class PushHubAction extends Action
 
     /**
      * Grab and validate a URL from POST parameters.
-     * @throws ClientException for malformed or non-http/https URLs
+     * @throws ClientException for malformed or non-http/https or blacklisted URLs
      */
     protected function argUrl($arg)
     {
@@ -208,13 +207,14 @@ class PushHubAction extends Action
         $params = array('domain_check' => false, // otherwise breaks my local tests :P
                         'allowed_schemes' => array('http', 'https'));
         $validate = new Validate();
-        if ($validate->uri($url, $params)) {
-            return $url;
-        } else {
+        if (!$validate->uri($url, $params)) {
             // TRANS: Client exception.
             // TRANS: %1$s is this argument to the method this exception occurs in, %2$s is a URL.
             throw new ClientException(sprintf(_m('Invalid URL passed for %1$s: "%2$s"'),$arg,$url));
         }
+
+        Event::handle('UrlBlacklistTest', array($url));
+        return $url;
     }
 
     /**