Przeglądaj źródła

Fix favicon hashing in GReader API (#7573)

* Fix favicon hashing in GReader API (#7570)

This allows the correct iconUrl to be returned from the GReader API for
a given feed.

* Fix method signature

* Fix Fever API

---------

Co-authored-by: CarelessCaution <189675655+CarelessCaution@users.noreply.github.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
CarelessCaution 11 miesięcy temu
rodzic
commit
c6f09e1ae4
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      p/api/fever.php
  2. 1 1
      p/api/greader.php

+ 1 - 1
p/api/fever.php

@@ -360,7 +360,7 @@ final class FeverAPI
 		$myFeeds = $this->feedDAO->listFeeds();
 
 		foreach ($myFeeds as $feed) {
-			$id = hash('crc32b', $salt . $feed->url());
+			$id = $feed->hashFavicon();
 			$filename = DATA_PATH . '/favicons/' . $id . '.ico';
 			if (!file_exists($filename)) {
 				continue;

+ 1 - 1
p/api/greader.php

@@ -353,7 +353,7 @@ final class GReaderAPI {
 					//'firstitemmsec' => 0,
 					'url' => htmlspecialchars_decode($feed->url(), ENT_QUOTES),
 					'htmlUrl' => htmlspecialchars_decode($feed->website(), ENT_QUOTES),
-					'iconUrl' => $faviconsUrl . hash('crc32b', $salt . $feed->url()),
+					'iconUrl' => $faviconsUrl . $feed->hashFavicon(),
 				];
 			}
 		}