A free, self-hostable news aggregator…
Hot fix: fix type hint null regression (#4207)
Alexandre Alapetite946b0a0876f1
diff --git a/app/Models/Feed.php b/app/Models/Feed.phpindex 48aba2b4b..3425f4bce 100644--- a/app/Models/Feed.php+++ b/app/Models/Feed.php@@ -33,7 +33,7 @@ class FreshRSS_Feed extends Minz_Model {private $ttl = self::TTL_DEFAULT;private $attributes = [];private $mute = false;- private $hash = null;+ private $hash = '';private $lockPath = '';private $hubUrl = '';private $selfUrl = '';@@ -58,7 +58,7 @@ class FreshRSS_Feed extends Minz_Model {}public function hash(): string {- if ($this->hash === null) {+ if ($this->hash == '') {$salt = FreshRSS_Context::$system_conf->salt;$this->hash = hash('crc32b', $salt . $this->url);}@@ -191,7 +191,7 @@ class FreshRSS_Feed extends Minz_Model {$this->id = intval($value);}public function _url(string $value, bool $validate = true) {- $this->hash = null;+ $this->hash = '';if ($validate) {$value = checkUrl($value);}@@ -304,9 +304,9 @@ class FreshRSS_Feed extends Minz_Model {}$links = $simplePie->get_links('self');- $this->selfUrl = isset($links[0]) ? $links[0] : null;+ $this->selfUrl = $links[0] ?? '';$links = $simplePie->get_links('hub');- $this->hubUrl = isset($links[0]) ? $links[0] : null;+ $this->hubUrl = $links[0] ?? '';if ($loadDetails) {// si on a utilisé l’auto-discover, notre url va avoir changédiff --git a/lib/lib_rss.php b/lib/lib_rss.phpindex b608743f3..e020236ea 100644--- a/lib/lib_rss.php+++ b/lib/lib_rss.php@@ -193,7 +193,10 @@ function timestamptodate ($t, $hour = true) {return @date ($date, $t);}-function html_only_entity_decode(string $text): string {+/**+ * @param string|null $text+ */+function html_only_entity_decode($text): string {static $htmlEntitiesOnly = null;if ($htmlEntitiesOnly === null) {$htmlEntitiesOnly = array_flip(array_diff(