SMF Support > phpBB

SMF Converter - phpBB3 - Board import should use stripslashes()

(1/1)

syncopix:
Hi,

I was importing from a phpBB3 install to SMF 2.0 RC5 earlier and noted that imported board names and descriptions had escape slashes in them.

Here is a diff against the current Phpbb 3 to SMF 2-0-rc4 Converter that corrects this issue:


--- Code: ------ phpbb3_to_smf.sql   2010-10-24 15:07:33.000000000 +0100
+++ ../forum/phpbb3_to_smf.sql  2011-04-06 21:07:17.000000000 +0100
@@ -396,9 +396,12 @@

 ---* {$to_prefix}boards
 ---{
+$ignore_slashes = true;
 if (empty($row['id_cat']))
        $row['id_cat'] = 1;
 $row['name'] = str_replace('\n', '<br />', $row['name']);
+$row['name'] = stripslashes($row['name']);
+$row['description'] = stripslashes($row['description']);
 ---}
 SELECT
        f.forum_id AS id_board, CASE WHEN f.parent_id = c.temp_id THEN 0 ELSE f.parent_id END AS id_parent, f.left_id AS board_order, f.forum_posts AS num_posts,
@@ -711,4 +714,4 @@
        post_msg_id AS id_msg, download_count AS downloads,
        real_filename AS filename, physical_filename, filesize AS size
 FROM {$from_prefix}attachments;
----*
\ No newline at end of file
+---*

--- End code ---

Joshua Dickerson:
I really, really hate working with converters because it means that I have to install more software. Can someone else confirm this is a bug and test the fix?

emanuele:
* emanuele feels the same... :P

Trekkie101:
It's a bug, we should probably strip a lot more fields on pretty much everything unless we're casting the variables to a set type. Can't ever trust those rogue dev's :P

Navigation

[0] Message Index

Go to full version