@@ -63,7 +63,6 @@ public static function getTableClasses()
6363 */
6464 public function insertContent ()
6565 {
66- $ validBlogId = intval ($ this ->blogId );
6766 // Language file already loaded, so we can use translated text
6867
6968 // Insert SQL
@@ -82,7 +81,8 @@ public function insertContent()
8281 // Insert data to WP tables
8382 foreach ($ arrInsertSQL AS $ sqlTable => $ sqlData )
8483 {
85- $ sqlQuery = "INSERT INTO ` {$ this ->conf ->getBlogPrefix ($ this ->blogId )}{$ sqlTable }` {$ sqlData }" ;
84+ $ replacedSQL_Data = $ this ->parseBBCodes ($ sqlData );
85+ $ sqlQuery = "INSERT INTO ` {$ this ->conf ->getBlogPrefix ($ this ->blogId )}{$ sqlTable }` {$ replacedSQL_Data }" ;
8686 $ ok = $ this ->conf ->getInternalWPDB ()->query ($ sqlQuery );
8787 if ($ ok === FALSE )
8888 {
@@ -101,10 +101,10 @@ public function insertContent()
101101 // Parse shortcodes and make SQL queries
102102 foreach ($ arrPluginInsertSQL AS $ sqlTable => $ sqlData )
103103 {
104- $ sqlData = $ this ->parseBBCodes ($ sqlData );
104+ $ replacedSQL_Data = $ this ->parseBBCodes ($ sqlData );
105105
106106 // Note: we don't use blog_id param for getPrefix, as it is always the same
107- $ sqlQuery = "INSERT INTO ` {$ this ->conf ->getPrefix ()}{$ sqlTable }` {$ sqlData }" ;
107+ $ sqlQuery = "INSERT INTO ` {$ this ->conf ->getPrefix ()}{$ sqlTable }` {$ replacedSQL_Data }" ;
108108 $ ok = $ this ->conf ->getInternalWPDB ()->query ($ sqlQuery );
109109 if ($ ok === FALSE )
110110 {
@@ -157,9 +157,10 @@ public function resetContent()
157157 // Replace data to WP tables
158158 foreach ($ arrReplaceSQL AS $ sqlTable => $ sqlData )
159159 {
160+ $ replacedSQL_Data = $ this ->parseBBCodes ($ sqlData );
160161 // Note - MySQL 'REPLACE INTO' works like MySQL 'INSERT INTO', except that if there is a row
161162 // with the same key you are trying to insert, it will be deleted on replace instead of giving you an error.
162- $ sqlQuery = "REPLACE INTO ` {$ this ->conf ->getBlogPrefix ($ this ->blogId )}{$ sqlTable }` {$ sqlData }" ;
163+ $ sqlQuery = "REPLACE INTO ` {$ this ->conf ->getBlogPrefix ($ this ->blogId )}{$ sqlTable }` {$ replacedSQL_Data }" ;
163164 $ ok = $ this ->conf ->getInternalWPDB ()->query ($ sqlQuery );
164165 if ($ ok === FALSE )
165166 {
@@ -178,9 +179,9 @@ public function resetContent()
178179 // Parse shortcodes and make SQL queries
179180 foreach ($ arrPluginReplaceSQL AS $ sqlTable => $ sqlData )
180181 {
181- $ sqlData = str_replace ( ' [BLOG_ID] ' , intval ( $ this ->blogId ), $ sqlData );
182+ $ replacedSQL_Data = $ this ->parseBBCodes ( $ sqlData );
182183 // Note: we don't use blog_id param for getPrefix, as it is always the same
183- $ sqlQuery = "REPLACE INTO ` {$ this ->conf ->getPrefix ()}{$ sqlTable }` {$ sqlData }" ;
184+ $ sqlQuery = "REPLACE INTO ` {$ this ->conf ->getPrefix ()}{$ sqlTable }` {$ replacedSQL_Data }" ;
184185 $ ok = $ this ->conf ->getInternalWPDB ()->query ($ sqlQuery );
185186
186187 if ($ ok === FALSE )
0 commit comments