]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apigroupcreate.php
Validate::uri replaced with filter_var for HTTP[S] URL checks
[quix0rs-gnu-social.git] / actions / apigroupcreate.php
index 8615bcff7e9767c3ab7f4791cc7a32281ec0621a..ea23fdf3bae205e039a12b629fb4ecd706c9bd96 100644 (file)
@@ -35,8 +35,6 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/apiauth.php';
-
 /**
  * Make a new group. Sets the authenticated user as the administrator of the group.
  *
@@ -167,15 +165,9 @@ class ApiGroupCreateAction extends ApiAuthAction
             );
             return false;
 
-        } elseif (
-            !is_null($this->homepage)
-            && strlen($this->homepage) > 0
-            && !Validate::uri(
-                $this->homepage, array(
-                    'allowed_schemes' =>
-                    array('http', 'https')
-                )
-            )) {
+        } elseif (!is_null($this->homepage)
+                && strlen($this->homepage) > 0
+                && !common_valid_http_url($this->homepage)) {
             $this->clientError(
                 // TRANS: Client error in form for group creation.
                 _('Homepage is not a valid URL.'),
@@ -297,13 +289,13 @@ class ApiGroupCreateAction extends ApiAuthAction
      */
     function groupNicknameExists($nickname)
     {
-        $local = Local_group::staticGet('nickname', $nickname);
+        $local = Local_group::getKV('nickname', $nickname);
 
         if (!empty($local)) {
             return true;
         }
 
-        $alias = Group_alias::staticGet('alias', $nickname);
+        $alias = Group_alias::getKV('alias', $nickname);
 
         if (!empty($alias)) {
             return true;