From: Tim Düsterhus Date: Thu, 2 Jun 2022 08:33:43 +0000 (+0200) Subject: Fix PHP 8.1 compatibility in UserRebuildDataWorker for NULL signatures X-Git-Tag: 5.5.0_RC_1~20 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8cf90dac71a2e42c56dafba6e23f0dd5a1c5d64c;p=GitHub%2FWoltLab%2FWCF.git Fix PHP 8.1 compatibility in UserRebuildDataWorker for NULL signatures see #4845 --- 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) {