X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fupdateprofile.php;h=16afba6182eec91ef797cb2308eb6f8265697c73;hb=03a08efce9bfe3be1673581594498b5d856d08b0;hp=e4382f67464f23d4c3b2b7d26611a539300bb1f3;hpb=3491bb2df7f7c823b68bcde9359ad5d43146dfa7;p=quix0rs-gnu-social.git diff --git a/actions/updateprofile.php b/actions/updateprofile.php index e4382f6746..16afba6182 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -70,20 +70,20 @@ class UpdateprofileAction extends Action { return false; } $nickname = $req->get_parameter('omb_listenee_nickname'); - if (!Validate::string($nickname, array('min_length' => 1, - 'max_length' => 64, - 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { + if ($nickname && !Validate::string($nickname, array('min_length' => 1, + 'max_length' => 64, + 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { $this->client_error(_t('Nickname must have only letters and numbers and no spaces.')); return false; } - $profile_url = $req->get_parameter('omb_listenee_profile'); - if (!common_valid_http_url($profile_url)) { - $this->client_error(_t("Invalid profile URL '$profile_url'.")); + $license = $req->get_parameter('omb_listenee_license'); + if ($license && !common_valid_http_url($license)) { + $this->client_error(_t("Invalid license URL '$license'")); return false; } - $license = $req->get_parameter('omb_listenee_license'); - if (!common_valid_http_url($license)) { - $this->client_error(_t("Invalid license URL '$license'.")); + $profile_url = $req->get_parameter('omb_listenee_profile'); + if ($profile_url && !common_valid_http_url($profile_url)) { + $this->client_error(_t("Invalid profile URL '$profile_url'.")); return false; } # optional stuff