<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Forbidden characters of Item code input]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7218</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7218&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Forbidden characters of Item code input.]]></description>
		<lastBuildDate>Mon, 25 Dec 2017 14:47:36 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Forbidden characters of Item code input]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30285#p30285</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 25 Dec 2017 14:47:36 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30285#p30285</guid>
		</item>
		<item>
			<title><![CDATA[Forbidden characters of Item code input]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30284#p30284</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (notrinos)]]></author>
			<pubDate>Mon, 25 Dec 2017 13:07:19 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30284#p30284</guid>
		</item>
	</channel>
</rss>
