|
@@ -146,8 +146,8 @@ final class HelloWorldExtension extends Minz_Extension
|
|
|
public function init(): void {
|
|
public function init(): void {
|
|
|
parent::init();
|
|
parent::init();
|
|
|
|
|
|
|
|
- $this->registerHook(Minz_HookType::EntryBeforeDisplay, [$this, 'renderEntry'], 10);
|
|
|
|
|
- $this->registerHook(Minz_HookType::CheckUrlBeforeAdd, [self::class, 'checkUrl'], -10);
|
|
|
|
|
|
|
+ $this->registerHook(Minz_HookType::EntryBeforeDisplay, $this->renderEntry(...), 10);
|
|
|
|
|
+ $this->registerHook(Minz_HookType::CheckUrlBeforeAdd, self::checkUrlBeforeAdd(...), -10);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function renderEntry(FreshRSS_Entry $entry): FreshRSS_Entry {
|
|
public function renderEntry(FreshRSS_Entry $entry): FreshRSS_Entry {
|
|
@@ -156,7 +156,7 @@ final class HelloWorldExtension extends Minz_Extension
|
|
|
return $entry;
|
|
return $entry;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static function checkUrlBeforeAdd(string $url): string {
|
|
|
|
|
|
|
+ public static function checkUrlBeforeAdd(string $url): ?string {
|
|
|
if (str_starts_with($url, 'https://')) {
|
|
if (str_starts_with($url, 'https://')) {
|
|
|
return $url;
|
|
return $url;
|
|
|
}
|
|
}
|