$user = S::user();
if ($owner->isActive()) {
foreach ($changedFields as $field => $values) {
- XDB::execute('INSERT INTO profile_modifications (pid, uid, field, oldText, newText, type, timestamp)
- VALUES ({?}, {?}, {?}, {?}, {?}, {?}, NOW())
- ON DUPLICATE KEY UPDATE uid = VALUES(uid), oldText = IF(VALUES(type) != type, VALUES(oldText), oldText),
- newText = VALUES(newText), type = VALUES(type), timestamp = NOW()',
- $this->pid(), $user->id(), Profile::$descriptions[$field], $values[0], $values[1],
- ($owner->id() == $user->id()) ? 'self' : 'third_party');
+ if (!is_null($field)) {
+ XDB::execute('INSERT INTO profile_modifications (pid, uid, field, oldText, newText, type, timestamp)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, NOW())
+ ON DUPLICATE KEY UPDATE uid = VALUES(uid), oldText = IF(VALUES(type) != type, VALUES(oldText), oldText),
+ newText = VALUES(newText), type = VALUES(type), timestamp = NOW()',
+ $this->pid(), $user->id(), Profile::$descriptions[$field], $values[0], $values[1],
+ ($owner->id() == $user->id()) ? 'self' : 'third_party');
+ }
}
}
return true;