diff --git a/models.php b/models.php index f5bf3d3..d6233a2 100644 --- a/models.php +++ b/models.php @@ -22,6 +22,7 @@ public function __construct($mention) { class WebmentionStore { public function add_mention($mention) { $file_path = APP_DATA_DIR . DIRECTORY_SEPARATOR . $mention->mentionId . ".json"; + $mention->data['published'] = $mention->data['published'] ?? $mention->data['wm-received']; file_put_contents( $file_path, json_encode($mention->data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)