<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[PunBB Forums - Email setting validation]]></title>
		<link>http://punbb.informer.com/forums/topic/21808/email-setting-validation/</link>
		<description><![CDATA[The most recent posts in Email setting validation.]]></description>
		<lastBuildDate>Tue, 23 Jun 2009 06:42:30 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Email setting validation]]></title>
			<link>http://punbb.informer.com/forums/post/128608/#p128608</link>
			<description><![CDATA[<p>Thanks, <a href="http://punbb.informer.com/trac/changeset/1207">fixed</a></p>]]></description>
			<author><![CDATA[dummy@example.com (Slavok)]]></author>
			<pubDate>Tue, 23 Jun 2009 06:42:30 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128608/#p128608</guid>
		</item>
		<item>
			<title><![CDATA[Email setting validation]]></title>
			<link>http://punbb.informer.com/forums/post/128606/#p128606</link>
			<description><![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>]]></description>
			<author><![CDATA[dummy@example.com (hoover90)]]></author>
			<pubDate>Mon, 22 Jun 2009 23:39:14 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128606/#p128606</guid>
		</item>
	</channel>
</rss>
