<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Forbidden characters of Item code input]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7218&amp;type=atom" />
	<updated>2017-12-25T14:47:36Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7218</id>
		<entry>
			<title type="html"><![CDATA[Re: Forbidden characters of Item code input]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=30285#p30285" />
			<content type="html"><![CDATA[<p>The user input control functions that provide the dropdown select box php code should not get confused and the search delimiters should not be ambiguous. URL encoding too will convert space to &quot;+&quot;.</p><p>We can also add the back tick character to the forbidden list it as well - &quot;`&quot;. A semicolon too may be added to the list.</p><p>Here is an <a href="http://board.phpbuilder.com/showthread.php?10382553-Check-if-string-contains-any-value-in-an-array&amp;s=b3b4a0d3f0ceddd92657c1903a172c17&amp;p=10992815&amp;viewfull=1#post10992815">elegant way</a> to check a string for presence of any character in an array:<br /></p><div class="codebox"><pre><code>$arrayOfBadCharacters =array(&#039; &#039;, &quot;&#039;&quot;, &#039;&quot;&#039;, &#039;+&#039;, &#039;&amp;&#039;, chr(9), chr(10), chr(13), &#039;`&#039;, &#039;;&#039;);
$chars = preg_quote(implode(&#039;&#039;, $arrayOfBadCharacters));
if(preg_match(&#039;/[&#039;.$chars.&#039;]/&#039;, $_POST[&#039;NewStockID&#039;]) {
    // bad character(s) found
}  </code></pre></div><p>These bad characters may be stripped off and the code used instead of throwing an error.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-12-25T14:47:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=30285#p30285</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Forbidden characters of Item code input]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=30284#p30284" />
			<content type="html"><![CDATA[<p>Line 182 of <strong>inventory/manage/items.php</strong> should be<br /></p><div class="codebox"><pre><code>elseif (strstr($_POST[&#039;NewStockID&#039;], &quot;-&quot;) || strstr($_POST[&#039;NewStockID&#039;],&quot;&#039;&quot;) || </code></pre></div><p>to prevent the <strong>-</strong> symbol entered by user<br />Can someone explain about the forbidden characters in the <strong>Item code</strong> (- &#039; &quot; + &amp; space), is the reason security ?</p>]]></content>
			<author>
				<name><![CDATA[notrinos]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36772</uri>
			</author>
			<updated>2017-12-25T13:07:19Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=30284#p30284</id>
		</entry>
</feed>
