summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-06-12 15:53:24 -0400
committerEvan Prodromou <evan@prodromou.name>2008-06-12 15:53:24 -0400
commit47c3e474becc94287e5afce4ec70992266e7ee6b (patch)
treeaa2d7c82ada4af38a66b2b19b29df731db4bbd98 /actions
parentfa79d2c1d414d69a32c894dded368ee42fb021ca (diff)
only validate if values are sent
darcs-hash:20080612195324-84dde-cab5efa3218f3cd3632ced1c819a5be2edb3c5a0.gz
Diffstat (limited to 'actions')
-rw-r--r--actions/updateprofile.php18
1 files changed, 9 insertions, 9 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