<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[PunBB Forums - Email setting validation]]></title>
	<link rel="self" href="http://punbb.informer.com/forums/feed/atom/topic/21808/"/>
	<updated>2009-06-23T06:42:30Z</updated>
	<generator>PunBB</generator>
	<id>http://punbb.informer.com/forums/topic/21808/email-setting-validation/</id>
		<entry>
			<title type="html"><![CDATA[Re: Email setting validation]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/128608/#p128608"/>
			<content type="html"><![CDATA[<p>Thanks, <a href="http://punbb.informer.com/trac/changeset/1207">fixed</a></p>]]></content>
			<author>
				<name><![CDATA[Slavok]]></name>
				<uri>http://punbb.informer.com/forums/user/13265/</uri>
			</author>
			<updated>2009-06-23T06:42:30Z</updated>
			<id>http://punbb.informer.com/forums/post/128608/#p128608</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Email setting validation]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/128606/#p128606"/>
			<content type="html"><![CDATA[<p>Line 962 in profile.php:<br /></p><div class="codebox"><pre><code>if ($form[&#039;email_setting&#039;] &lt; 0 &amp;&amp; $form[&#039;email_setting&#039;] &gt; 2) $form[&#039;email_setting&#039;] = 1;</code></pre></div><p>If $form[&#039;email_setting&#039;] less than 0 AND $form[&#039;email_setting&#039;] greater than 2 <br />SET $form[&#039;email_setting&#039;] equal to 1.</p><p>I&#039;m a little rusty with PHP, but it seems to me that the boolean &#039;AND&#039; in the code should be a boolean &#039;OR.&#039;&nbsp; Valid options seem to be 0, 1, and 2, therefore we should be setting $form[&#039;email_setting&#039;] to 1 if it&#039;s outside this range, not if it&#039;s both below and above it at the same time.&nbsp; I think either of these would work as expected:&nbsp; </p><div class="codebox"><pre><code>if ($form[&#039;email_setting&#039;] &lt; 0 || $form[&#039;email_setting&#039;] &gt; 2) $form[&#039;email_setting&#039;] = 1;</code></pre></div><div class="codebox"><pre><code>if !($form[&#039;email_setting&#039;] &lt; 0 &amp;&amp; $form[&#039;email_setting&#039;] &gt; 2) $form[&#039;email_setting&#039;] = 1;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[hoover90]]></name>
				<uri>http://punbb.informer.com/forums/user/15680/</uri>
			</author>
			<updated>2009-06-22T23:39:14Z</updated>
			<id>http://punbb.informer.com/forums/post/128606/#p128606</id>
		</entry>
</feed>
