Skip to content

[BUG] actualize_script.php fails if the feed is empty when run by php8 #3537

@klausenbusk

Description

@klausenbusk

Describe the bug
Running actualize_script.php with php8 results in a fatal error if the feed doesn't contain any content (ex: https://dolphin-emu.org/blog/feeds/ which returns nothing if the Accept-Language: en header is missing), this doesn't happen when the script is run by php7.

To Reproduce

  1. Add https://dolphin-emu.org/blog/feeds/ as a feed
  2. Run actualize_script.php

Expected behavior
actualize_script.php should update the feeds.

Log

$ sudo -u http php /var/www/freshrss/app/actualize_script.php
PHP Warning:  Module "curl" is already loaded in Unknown on line 0
FreshRSS starting feeds actualization at 2021-03-17T21:33:47+00:00
FreshRSS actualize foobar...
PHP Fatal error:  Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /var/www/freshrss/lib/SimplePie/SimplePie/Locator.php:83
Stack trace:
#0 /var/www/freshrss/lib/SimplePie/SimplePie/Locator.php(83): DOMDocument->loadHTML()
#1 [internal function]: SimplePie_Locator->__construct()
#2 /var/www/freshrss/lib/SimplePie/SimplePie/Registry.php(183): ReflectionClass->newInstanceArgs()
#3 /var/www/freshrss/lib/SimplePie/SimplePie.php(1746): SimplePie_Registry->create()
#4 /var/www/freshrss/lib/SimplePie/SimplePie.php(1468): SimplePie->fetch_data()
#5 /var/www/freshrss/app/Models/Feed.php(285): SimplePie->init()
#6 /var/www/freshrss/app/Controllers/feedController.php(349): FreshRSS_Feed->load()
#7 /var/www/freshrss/app/Controllers/feedController.php(566): FreshRSS_feed_Controller::actualizeFeed()
#8 /var/www/freshrss/lib/Minz/Dispatcher.php(119): FreshRSS_feed_Controller->actualizeAction()
#9 /var/www/freshrss/lib/Minz/Dispatcher.php(47): Minz_Dispatcher->launchAction()
#10 /var/www/freshrss/lib/Minz/FrontController.php(81): Minz_Dispatcher->run()
#11 /var/www/freshrss/app/actualize_script.php(81): Minz_FrontController->run()
#12 {main}
  thrown in /var/www/freshrss/lib/SimplePie/SimplePie/Locator.php on line 83
Results: 
foobar

Environment information (please complete the following information):

  • OS: Arch Linux
  • FreshRSS version: 1.18.0
  • Database version: MariaDB 10.5.9
  • PHP version: 8.0.3
  • Installation type: git

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions