<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Single and double quote in Item Description]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5350&amp;type=atom" />
	<updated>2015-02-16T10:05:41Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=5350</id>
		<entry>
			<title type="html"><![CDATA[Re: Single and double quote in Item Description]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=22569#p22569" />
			<content type="html"><![CDATA[<p>This needs to be fixed in FA 2.3 itself so that there is no carry forward errors into FA 2.4.....</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2015-02-16T10:05:41Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=22569#p22569</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single and double quote in Item Description]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=22567#p22567" />
			<content type="html"><![CDATA[<p>I would rather wait that the new version of FA fixes it, otherwise, I would have to run a find/replace each time FA has a new version.<br />______________________<br />Are you interested in <a href="http://www.pass4sure.co.uk">pass4sure</a> Get our self paced <a href="http://www.pass4sure.co.uk/CompTIA-A-plus-training.html">a+ notes</a> itil study packages to pass your <a href="http://www.rasmussen.edu/">rasmussen</a> without any <a href="http://en.wikipedia.org/wiki/Hobe_Sound_Bible_College">Hobe Sound Bible College</a> lsat.</p>]]></content>
			<author>
				<name><![CDATA[pyaramosam]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20120</uri>
			</author>
			<updated>2015-02-16T07:28:07Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=22567#p22567</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single and double quote in Item Description]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21679#p21679" />
			<content type="html"><![CDATA[<p>I hope our chief developer, Janusz, sees this.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2014-12-06T11:43:41Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21679#p21679</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single and double quote in Item Description]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21676#p21676" />
			<content type="html"><![CDATA[<p>That&#039;s right. Waiting for @joe to clarify way forward and integrate a fix.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-12-06T09:22:56Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21676#p21676</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single and double quote in Item Description]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21672#p21672" />
			<content type="html"><![CDATA[<p>whaoo, I would rather wait that the new version of FA fixes it, otherwise, I would have to run a find/replace each time FA has a new version.<br />I think i should mention that to Joe, so he can consider it for the next version, right ?<br />Tx</p>]]></content>
			<author>
				<name><![CDATA[DavidMaurice]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19673</uri>
			</author>
			<updated>2014-12-06T06:26:21Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21672#p21672</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single and double quote in Item Description]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21671#p21671" />
			<content type="html"><![CDATA[<p>A possible search and replace using the QUOTE() function of MySQL may be one solution. Another would be a search and replace of such known entities in the most affected fields or in the db_escape function itself. This is also the reason why the currency symbols stand as &quot;?&quot; in the CoA sqls.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-12-06T06:16:07Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21671#p21671</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single and double quote in Item Description]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21669#p21669" />
			<content type="html"><![CDATA[<p>Hi Apmuthu,<br />Tx for this post, which i understand, but what can we do then to fix this ?<br />One of my customer is named O&#039;brian, and it displays &quot;O&#039;Brian&quot;.<br />Tx</p>]]></content>
			<author>
				<name><![CDATA[DavidMaurice]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19673</uri>
			</author>
			<updated>2014-12-06T06:04:09Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21669#p21669</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Single and double quote in Item Description]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21593#p21593" />
			<content type="html"><![CDATA[<p>Items like &quot;Pipe 15 ft long&quot; in the Item description displays fine. But if the abbreviation of feet as as an apostrophe / single quote is used, then it gets entered into the table as <strong>&amp;#039;</strong> instead. </p><p>Hence the Item: &quot;Pipe 15&#039; long&quot; now becomes &quot;Pipe 15&amp;#039; long&quot;</p><p>This is due to the way <strong>function db_escape()</strong> is programmed in <strong>includes/db/connect_db.inc</strong>.<br /></p><div class="codebox"><pre><code>function db_escape($value = &quot;&quot;, $nullify = false)
{
    $value = @html_entity_decode($value, ENT_QUOTES, $_SESSION[&#039;language&#039;]-&gt;encoding);
    $value = @htmlspecialchars($value, ENT_QUOTES, $_SESSION[&#039;language&#039;]-&gt;encoding);

      //reset default if second parameter is skipped
    $nullify = ($nullify === null) ? (false) : ($nullify);

      //check for null/unset/empty strings
    if ((!isset($value)) || (is_null($value)) || ($value === &quot;&quot;)) {
        $value = ($nullify) ? (&quot;NULL&quot;) : (&quot;&#039;&#039;&quot;);
    } else {
        if (is_string($value)) {
              //value is a string and should be quoted; determine best method based on available extensions
            if (function_exists(&#039;mysql_real_escape_string&#039;)) {
                  $value = &quot;&#039;&quot; . mysql_real_escape_string($value) . &quot;&#039;&quot;;
            } else {
              $value = &quot;&#039;&quot; . mysql_escape_string($value) . &quot;&#039;&quot;;
            }
        } else if (!is_numeric($value)) {
            //value is not a string nor numeric
            display_error(&quot;ERROR: incorrect data type send to sql query&quot;);
            echo &#039;&lt;br&gt;&lt;br&gt;&#039;;
            exit();
        }
    }
    return $value;
}</code></pre></div><p>MySQL now has an builtin <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_quote"><strong>QUOTE()</strong> function</a> that can now dispense with quoting / cleaning up any string to be entered through SQL directly.</p><p>The use of <strong>htmlspecialchars()</strong> is dictated by certain PHP environment settings:<br /></p><div class="codebox"><pre><code>&#039; &quot; &#039; (double quote) becomes &#039;&amp;quot;&#039; when ENT_NOQUOTES is not set. 
&quot; &#039; &quot; (single quote) becomes &#039;&amp;#039;&#039; only when ENT_QUOTES is set. </code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-11-28T16:09:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21593#p21593</id>
		</entry>
</feed>
