PDA

View Full Version : ImpEx crashes while importing from Invision Board 2 (2.3.0)


ovdt
Mon 29th Sep '08, 7:48am
A Fatal Error taps the whole post importing process.
Importing from Invision Board v 2.2.2
Installed add ons: blog, gallery, and arcade

Importing process crashes while importing Posts. Actually just one post causes the problem and of course i couldn't manage to determine which post.

Error message reads:
-------------------------
Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\www\vhosts\localhost\vb\impex\systems\ipb2\000. php(78) : regexp code on line 1

Fatal error: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Failed evaluating code: $this-&gt;unconvert_size(&quot;14pt;line-height:100%\'&gt;1. PHP&lt;/span&gt;&lt;/b&gt;[/u]&lt;br /&gt;==============================&lt;br /&gt;====Dosya: getvar.php =============&lt;br /&gt;==============================&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;$connect = mysql_connect(\&quot;localhost\&quot;, \&quot;root\&quot;, \&quot;\&quot;);&lt;br /&gt;mysql_select_db(\&quot;test\&quot;, $connect);&lt;br /&gt;$result = mysql_query(\&quot;SELECT ad, soyad, sehir FROM user\&quot;);&lt;br /&gt;while($row=mysql_fetch_array($result)){&lt;br /&gt; $ad[]=$row[&amp;#39;ad&amp;#39;];&lt;br /&gt; $soyad[]=$row[&amp;#39;soyad&amp;#39;];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$comma_separated1 = implode(\&quot;,\&quot;, $ad);&lt;br /&gt;$comma_separated2 = implode(\&quot;,\&quot;, $soyad);&lt;br /&gt;print \&quot;ad=\&quot;.$comma_separated1.\&quot;&amp;soyad=\&quot;.$comma_separ ated2;&lt;br /&gt;&lt;br /&gt;?&gt in C:\www\vhosts\localhost\vb\impex\systems\ipb2\000. php on line 78
----------------------------

Apparently a problem with some regular expression emerges. I've tried putting try catch blog around the problematic 78th line but it did not work.

By the way I'm not trying to get a perfect importing process (that would be perfect though). I just want to circumvent the problem. If one can at least help me to determine which post causes the problem i can just delete that post. Because I'm doing this importing process in a limited time frame.

Thank you.

Jerry
Tue 30th Sep '08, 7:15pm
If you comment out the 2 lines in 000.php it will bypass the function :

$text = preg_replace('#<span style=\'font-size:(.+?)pt;line-height:100%\'>(.+?)</span>#esiU', '\$this->unconvert_size("\\1", "\\2")', $text);
$text = preg_replace('#<span style="font-size:(.+?)pt;line-height:100%">(.+?)</span>#esiU', '\$this->unconvert_size("\\1", "\\2")', $text);

ovdt
Wed 1st Oct '08, 8:48am
Hi,
By circumventing I meant by-passing the problematic lines just for that specific post. Otherwise I know how to comment out lines.

Anyway. I've found the buggy post and immediatelly figured out the problem. The post includes PHP code. Since ImpEx uses "in-text evaluation" of PHP in this particular line of code, it messes up the process. Yes, here is a bug for you!!!

We have solve the problem by just deleting the post. However one can also prevent the problem by altering the post. Or of course adding two more lines to make "out-text" evaluation of that function call.