[git] web/master.git branch master updated. 060b159

From: Date: Sun, 22 Jan 2012 08:01:41 +0000
Subject: [git] web/master.git branch master updated. 060b159
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-12860@lists.php.net to get a copy of this message
The branch, master on web/master.git has been updated from d764e4becbcf2c4d669c190e2bd248d1f801ef33 (commit) to 060b15932bb5702bf8ea0e9c141adf55a1b9bed3 (commit) http://git.php.net/?p=web/master.git;a=log;h=060b15932bb5702bf8ea0e9c141adf55a1b9bed3;hp=d764e4becbcf2c4d669c190e2bd248d1f801ef33 Summary of changes: manage/users.php | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) -- Log ---------------------------------------- commit 060b15932bb5702bf8ea0e9c141adf55a1b9bed3 Author: Rasmus Lerdorf <rasmus@php.net> Date: Sat Jan 21 23:56:42 2012 -0800 more cleanup diff --git a/manage/users.php b/manage/users.php index 4a8c839..ac037dc 100644 --- a/manage/users.php +++ b/manage/users.php @@ -136,18 +136,18 @@ if ($id && $in) { $enable = empty($in['enable']) ? 0 : 1; $spamprotect = empty($in['spamprotect']) ? 0 : 1; $verified = empty($in['verified']) ? 0 : 1; - $use_sa = isset($in['use_sa']) ? (int)$in['use_sa'] : 0; + $use_sa = empty($in['use_sa']) ? 0 : (int)$in['use_sa']; $greylist = empty($in['greylist']) ? 0 : 1; if ($id) { # update main table data - if (isset($in['email']) && isset($in['name'])) { + if (!empty($in['email']) && !empty($in['name'])) { $query = "UPDATE users SET name='$in[name]',email='$in[email]'" . (!empty($in['passwd']) ? ",passwd='$in[passwd]'" : "") . (!empty($in['svnpasswd']) ? ",svnpasswd='$in[svnpasswd]'" : "") . (!empty($in['md5passwd']) ? ",md5passwd='$in[md5passwd]'" : "") . (!empty($in['sshkey']) ? ",ssh_keys='$in[sshkey]'" : "") - . ((is_admin($user) && isset($in['username'])) ? ",username='$in[username]'" : "") + . ((is_admin($user) && !empty($in['username'])) ? ",username='$in[username]'" : "") . (is_admin($user) ? ",cvsaccess=$cvsaccess" : "") . ",spamprotect=$spamprotect" . ",verified=$verified" @@ -431,16 +431,16 @@ while ($row = mysql_fetch_array($res)) { foot(); function invalid_input($in) { - if (isset($in['email']) && strlen($in['email']) && !is_emailable_address($in['email'])) { + if (!empty($in['email']) && strlen($in['email']) && !is_emailable_address($in['email'])) { return "'".clean($in['email'])."' does not look like a valid email address"; } - if (isset($in['username']) && !preg_match("/^[-\w]+\$/",$in['username'])) { + if (!empty($in['username']) && !preg_match("/^[-\w]+\$/",$in['username'])) { return "'".clean($in['username'])."' is not a valid username"; } - if (isset($in['rawpasswd']) && $in['rawpasswd'] != $in['rawpasswd2']) { + if (!empty($in['rawpasswd']) && $in['rawpasswd'] != $in['rawpasswd2']) { return "the passwords you specified did not match!"; } - if (isset($in['sshkey']) && !verify_ssh_keys($in['sshkey'])) { + if (!empty($in['sshkey']) && !verify_ssh_keys($in['sshkey'])) { return "the ssh key doesn't seem to have the necessary format"; } Thank you for your contribution.

« previous php.webmaster (#12860) next »