Просмотр исходного кода

Include enclosures in entries hash (#7719)

* Include enclosures in entries hash
Fix https://github.com/FreshRSS/FreshRSS/issues/7718
Negative side-effect: users using the option to automatically mark updated articles as unread will have some articles with enclosures appear as unread

* Changelog with warning
Alexandre Alapetite 8 месяцев назад
Родитель
Сommit
fe9ef3b506
2 измененных файлов с 4 добавлено и 1 удалено
  1. 2 0
      CHANGELOG.md
  2. 2 1
      app/Models/Entry.php

+ 2 - 0
CHANGELOG.md

@@ -18,6 +18,8 @@ See also [the FreshRSS releases](https://github.com/FreshRSS/FreshRSS/releases).
 	* Fix multiple authentication HTTP headers [#7703](https://github.com/FreshRSS/FreshRSS/pull/7703)
 	* Fix HTML queries with a single feed [#7730](https://github.com/FreshRSS/FreshRSS/pull/7730)
 	* WebSub: only perform a redirection when coming from WebSub [#7738](https://github.com/FreshRSS/FreshRSS/pull/7738)
+	* Include enclosures in entries’ hash [#7719](https://github.com/FreshRSS/FreshRSS/pull/7719)
+		* Negative side-effect: users of the option to *automatically mark updated articles as unread* will once have some articles with enclosures re-appear as unread
 	* Fix cancellation of slider exit UI [#7705](https://github.com/FreshRSS/FreshRSS/pull/7705)
 	* Honor *disable update* on update page [#7733](https://github.com/FreshRSS/FreshRSS/pull/7733)
 	* Fix no registration limit setting [#7751](https://github.com/FreshRSS/FreshRSS/pull/7751)

+ 2 - 1
app/Models/Entry.php

@@ -481,8 +481,9 @@ HTML;
 
 	public function hash(): string {
 		if ($this->hash === '') {
+			$attributes = empty($this->attributeArray('enclosures')) ? '' : json_encode($this->attributes(), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
 			//Do not include $this->date because it may be automatically generated when lacking
-			$this->hash = md5($this->link . $this->title . $this->authors(true) . $this->originalContent() . $this->tags(true));
+			$this->hash = md5($this->link . $this->title . $this->authors(true) . $this->originalContent() . $this->tags(true) . $attributes);
 		}
 		return $this->hash;
 	}