summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/updateprofile.php18
-rw-r--r--lib/action.php2
2 files changed, 10 insertions, 10 deletions
diff --git a/actions/updateprofile.php b/actions/updateprofile.php
index e4382f674..16afba618 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
diff --git a/lib/action.php b/lib/action.php
index b2374b1d2..a4cae7066 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -67,7 +67,7 @@ class Action { // lawsuit
common_server_error($msg, $code);
}
- function client_error($msg, $code=500) {
+ function client_error($msg, $code=400) {
$action = $this->trimmed('action');
common_debug("User error '$code' on '$action': $msg", __FILE__);
common_user_error($msg, $code);