From: Marcel Werk Date: Wed, 2 Apr 2014 13:46:55 +0000 (+0200) Subject: Fixed SQL error in modification log handler X-Git-Tag: 2.0.5~15 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=99df0c71c8d24bbac7f06c8a8fb4d2fd821d41f5;p=GitHub%2FWoltLab%2FWCF.git Fixed SQL error in modification log handler --- diff --git a/wcfsetup/install/files/lib/system/log/modification/ModificationLogHandler.class.php b/wcfsetup/install/files/lib/system/log/modification/ModificationLogHandler.class.php index aa0b4d5e63..47a1bb08c9 100644 --- a/wcfsetup/install/files/lib/system/log/modification/ModificationLogHandler.class.php +++ b/wcfsetup/install/files/lib/system/log/modification/ModificationLogHandler.class.php @@ -65,12 +65,18 @@ class ModificationLogHandler extends SingletonFactory { throw new SystemException("Object type '".$objectType."' not found within definition 'com.woltlab.wcf.modifiableContent'"); } + if ($userID === null) $userID = WCF::getUser()->userID; + if ($username === null) { + if (WCF::getUser()->username) $username = WCF::getUser()->username; + else $username = ''; + } + return ModificationLogEditor::create(array( 'objectTypeID' => $objectTypeObj->objectTypeID, 'objectID' => $objectID, 'action' => $action, - 'userID' => ($userID === null ? WCF::getUser()->userID : $userID), - 'username' => ($username === null ? WCF::getUser()->username : $username), + 'userID' => $userID, + 'username' => $username, 'time' => $time, 'additionalData' => serialize($additionalData) ));