<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — minor change in restore functions]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5988&amp;type=atom" />
	<updated>2015-10-19T08:16:39Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=5988</id>
		<entry>
			<title type="html"><![CDATA[Re: minor change in restore functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24538#p24538" />
			<content type="html"><![CDATA[<p>you are right.</p>]]></content>
			<author>
				<name><![CDATA[serbanc]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=10111</uri>
			</author>
			<updated>2015-10-19T08:16:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24538#p24538</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: minor change in restore functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24535#p24535" />
			<content type="html"><![CDATA[<p>Blindly rewriting the input seems dangerous enough as it is. Your proposal means any sequence of digits followed by an underscore will be replaced, whereas it can currently only happen to the string &quot;0_&quot;.</p><p>I suggest line 305 be removed. Or at the very least be changed to consider some context. To make it foolproof we would need a parser for SQL, but extending the matched strings to each of the &quot;allowed commands&quot; might be good enough. At least until someone starts storing SQL queries in the database...</p><p>I&#039;m thinking something like<br />preg_replace(&quot;/CREATE TABLE \d+_/i&quot;, &quot;CREATE TABLE &quot;.$connection[&#039;tbpref&#039;], $line);<br />preg_replace(&quot;/INSERT INTO \d+_/i&quot;, &quot;INSERT INTO &quot;.$connection[&#039;tbpref&#039;], $line);<br />...</p><p>It might work, but it&#039;s not pretty.</p>]]></content>
			<author>
				<name><![CDATA[tm]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=17873</uri>
			</author>
			<updated>2015-10-18T05:32:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24535#p24535</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[minor change in restore functions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24534#p24534" />
			<content type="html"><![CDATA[<p>Gents,<br />I propose changing the line 305 in /admin/db/maintenance_db.inc from:<br />$line = str_replace(&quot;0_&quot;, $connection[&quot;tbpref&quot;], $line);<br />to<br />$line = preg_replace(&#039;/\d+_/&#039;, $connection[&#039;tbpref&#039;], $line);</p><p>This way, any restore with any prefix will be converted to current table prefix.</p><p>Regards,<br />Serban</p>]]></content>
			<author>
				<name><![CDATA[serbanc]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=10111</uri>
			</author>
			<updated>2015-10-17T21:09:12Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24534#p24534</id>
		</entry>
</feed>
