]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apicheckhub.php
Validate::uri replaced with filter_var for HTTP[S] URL checks
[quix0rs-gnu-social.git] / actions / apicheckhub.php
index d59506b667b415008b715a7a64166b5c45b5b44e..e32420d3c383dd8f1955fab1a76ebefec4a34cd8 100644 (file)
@@ -45,23 +45,18 @@ class ApiCheckHubAction extends ApiAuthAction
     {
         parent::prepare($args);
 
-               $this->url = urldecode($args['url']);
-               
-               if (!$this->url) {
+        $this->url = urldecode($args['url']);
+        
+        if (empty($this->url)) {
             $this->clientError(_('No URL.'), 403, 'json');
-            return;                    
-               }
+            return;            
+        }
 
-               if (!Validate::uri(
-                       $this->url, array(
-                           'allowed_schemes' =>
-                           array('http', 'https')
-                       )
-                   )) {
+        if (!common_valid_http_url($this->url)) {
             $this->clientError(_('Invalid URL.'), 403, 'json');
             return;
-                       }
-               
+        }
+        
         return true;
     }