diff --git a/extension.php b/extension.php index 3ad51b1..8e09109 100644 --- a/extension.php +++ b/extension.php @@ -12,9 +12,11 @@ class TelegramLinkFixerExtension extends Minz_Extension /** * Called automatically at extension load-time. Set up hooks here. */ + #[\Override] public function init() { // Hook into FreshRSS just before each entry is saved to database: + parent::init(); $this->registerHook('entry_before_insert', array($this, 'fixLink')); } @@ -24,6 +26,9 @@ class TelegramLinkFixerExtension extends Minz_Extension public function fixLink($entry) { try { + error_log("dump $entry:"); + var_dump($entry); + // Check if it's a telegram link $link = $entry->link(); error_log('TelegramLinkFixer: Processing entry with link: ' . $link); @@ -52,10 +57,11 @@ class TelegramLinkFixerExtension extends Minz_Extension } else { error_log('TelegramLinkFixer: No Telegraph link found in content'); } + return $entry; } catch (Exception $e) { - Minz_Log::error('TelegramLinkFixer: Error processing entry: ' . $e->getMessage()); - return $entry; + error_log('TelegramLinkFixer: Error processing entry: ' . $e->getMessage()); + return $entry; // Return the entry even if an exception occurs } } }