Fixed SQL error in modification log handler
authorMarcel Werk <burntime@woltlab.com>
Wed, 2 Apr 2014 13:46:55 +0000 (15:46 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 2 Apr 2014 13:46:55 +0000 (15:46 +0200)
wcfsetup/install/files/lib/system/log/modification/ModificationLogHandler.class.php

index aa0b4d5e63532eef521f86cb391416ecf43d96d3..47a1bb08c92d24fc244fbb0afb2705463e67d016 100644 (file)
@@ -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)
                ));