1 (edited by hoover90 2009-06-23 03:05)

Topic: Email setting validation

Line 962 in profile.php:

if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1;

If $form['email_setting'] less than 0 AND $form['email_setting'] greater than 2
SET $form['email_setting'] equal to 1.

I'm a little rusty with PHP, but it seems to me that the boolean 'AND' in the code should be a boolean 'OR.'  Valid options seem to be 0, 1, and 2, therefore we should be setting $form['email_setting'] to 1 if it's outside this range, not if it's both below and above it at the same time.  I think either of these would work as expected: 

if ($form['email_setting'] < 0 || $form['email_setting'] > 2) $form['email_setting'] = 1;
if !($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1;

Re: Email setting validation

Thanks, fixed