mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-02-07 03:51:04 -05:00
* Fix extension freshrss_user_maintenance in actualize_script Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3440 The hook was called before registering all the extensions for the current user * PHPStan Level 6 for extensions And remove 5-year old legacy format of enabled extensions < FreshRSS 1.11.1 * Fix multiple bugs in extensions * Minor typing * Don't change signature of methods supposed to be overridden * PHPStan Level 9 and compatibility Intelliphense * Set as final the methods not supposed to be overriden
15 lines
441 B
PHP
15 lines
441 B
PHP
<?php
|
|
|
|
class TumblrGdprExtension extends Minz_Extension {
|
|
/** @return void */
|
|
public function init() {
|
|
$this->registerHook('simplepie_before_init', array('TumblrGdprExtension', 'curlHook'));
|
|
}
|
|
|
|
public static function curlHook(SimplePie $simplePie, FreshRSS_Feed $feed): void {
|
|
if (preg_match('#^https?://[a-zA-Z_0-9-]+.tumblr.com/#i', $feed->url())) {
|
|
$simplePie->set_useragent(FRESHRSS_USERAGENT . ' like Baiduspider');
|
|
}
|
|
}
|
|
}
|