FIX: MyBB importer exposes deleted posts (#13700)

The MyBB importer exposes posts marked as deleted in MyBB. This may lead to a privacy issue.
This commit is contained in:
Ruoxin Wang 2021-07-22 17:55:02 +10:00 committed by GitHub
parent 3cf7a3766a
commit f9aaed7020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -26,6 +26,7 @@ class ImportScripts::MyBB < ImportScripts::Base
BATCH_SIZE = 1000 BATCH_SIZE = 1000
BASE = "" BASE = ""
QUIET = true QUIET = true
IMPORT_DELETED_POSTS = false
def initialize def initialize
super super
@ -115,6 +116,7 @@ class ImportScripts::MyBB < ImportScripts::Base
FROM #{TABLE_PREFIX}posts p, FROM #{TABLE_PREFIX}posts p,
#{TABLE_PREFIX}threads t #{TABLE_PREFIX}threads t
WHERE p.tid = t.tid WHERE p.tid = t.tid
#{'AND (p.visible = 1 AND t.visible = 1)' unless IMPORT_DELETED_POSTS}
ORDER BY p.dateline ORDER BY p.dateline
LIMIT #{BATCH_SIZE} LIMIT #{BATCH_SIZE}
OFFSET #{offset}; OFFSET #{offset};