From 8cf90dac71a2e42c56dafba6e23f0dd5a1c5d64c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 2 Jun 2022 10:33:43 +0200 Subject: [PATCH] Fix PHP 8.1 compatibility in UserRebuildDataWorker for NULL signatures see #4845 --- .../worker/UserRebuildDataWorker.class.php | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index 4882f0c7a2..7f4773e520 100644 --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@ -161,21 +161,23 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker ) )); - if (!$user->signatureEnableHtml) { - $htmlInputProcessor->process( - $user->signature, - 'com.woltlab.wcf.user.signature', - $user->userID, - true - ); + if ($user->signature) { + if (!$user->signatureEnableHtml) { + $htmlInputProcessor->process( + $user->signature, + 'com.woltlab.wcf.user.signature', + $user->userID, + true + ); - $user->update([ - 'signature' => $htmlInputProcessor->getHtml(), - 'signatureEnableHtml' => 1, - ]); - } else { - $htmlInputProcessor->reprocess($user->signature, 'com.woltlab.wcf.user.signature', $user->userID); - $user->update(['signature' => $htmlInputProcessor->getHtml()]); + $user->update([ + 'signature' => $htmlInputProcessor->getHtml(), + 'signatureEnableHtml' => 1, + ]); + } else { + $htmlInputProcessor->reprocess($user->signature, 'com.woltlab.wcf.user.signature', $user->userID); + $user->update(['signature' => $htmlInputProcessor->getHtml()]); + } } if ($user->aboutMe) { -- 2.20.1