Fixed missing signature processing during user rebuild
authorAlexander Ebert <ebert@woltlab.com>
Thu, 29 Sep 2016 18:00:13 +0000 (20:00 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 29 Sep 2016 18:00:13 +0000 (20:00 +0200)
wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php

index bd628ccad2d26e6331bbf615d1194f2ed61748fc..0ce57097c9c72845bee153a468d434ca2d6ae980 100644 (file)
@@ -8,6 +8,7 @@ use wcf\data\user\UserEditor;
 use wcf\data\user\UserList;
 use wcf\data\user\UserProfileAction;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
+use wcf\system\html\input\HtmlInputProcessor;
 use wcf\system\image\ImageHandler;
 use wcf\system\user\activity\point\UserActivityPointHandler;
 use wcf\system\WCF;
@@ -78,6 +79,22 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker {
                                $statement->execute($conditionBuilder->getParameters());
                        }
                        
+                       // update signatures
+                       $htmlInputProcessor = new HtmlInputProcessor();
+                       WCF::getDB()->beginTransaction();
+                       /** @var UserEditor $user */
+                       foreach ($users as $user) {
+                               if (!$user->signatureEnableHtml) {
+                                       $htmlInputProcessor->process($user->signature, 'com.woltlab.wcf.user.signature', $user->userID, true);
+                                       
+                                       $user->update([
+                                               'signature' => $htmlInputProcessor->getHtml(),
+                                               'signatureEnableHtml' => 1
+                                       ]);
+                               }
+                       }
+                       WCF::getDB()->commitTransaction();
+                       
                        // update old avatars
                        $avatarList = new UserAvatarList();
                        $avatarList->getConditionBuilder()->add('user_avatar.userID IN (?)', [$userIDs]);