aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-06-15 21:25:03 +0200
committerGravatar GitHub <noreply@github.com> 2025-06-15 21:25:03 +0200
commitb418b83bd4d064d2ecef3f072bffe8615f3e0ffa (patch)
tree12f1d7b6fc221d3986bcf0bfacefc43d74aa6398 /lib
parent67c42b0e7c4250d7befe61e35994d8f6e439ca7a (diff)
SimplePie: Fix propagation of HTTP error codes (#7670)
* SimplePie: Fix propagation of HTTP error codes fix https://github.com/FreshRSS/FreshRSS/issues/7038 https://github.com/FreshRSS/simplepie/pull/36 upstream https://github.com/simplepie/simplepie/pull/905 Co-authored-by: Edgar Alvarado <15692727+pe1uca@users.noreply.github.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/composer.json2
-rw-r--r--lib/simplepie/simplepie/src/HTTP/FileClient.php2
-rw-r--r--lib/simplepie/simplepie/src/SimplePie.php3
3 files changed, 4 insertions, 3 deletions
diff --git a/lib/composer.json b/lib/composer.json
index 97735d6e5..db2801fb8 100644
--- a/lib/composer.json
+++ b/lib/composer.json
@@ -14,7 +14,7 @@
"marienfressinaud/lib_opml": "0.5.1",
"phpgt/cssxpath": "v1.3.0",
"phpmailer/phpmailer": "6.10.0",
- "simplepie/simplepie": "dev-freshrss#2e668d7b1bc2787310b99d2fd59bfda96e31b6ae"
+ "simplepie/simplepie": "dev-freshrss#9a1c69be7d9dc2b766cef8697a2f1e88ab9a64e5"
},
"config": {
"sort-packages": true,
diff --git a/lib/simplepie/simplepie/src/HTTP/FileClient.php b/lib/simplepie/simplepie/src/HTTP/FileClient.php
index 4643038e0..2b21601c8 100644
--- a/lib/simplepie/simplepie/src/HTTP/FileClient.php
+++ b/lib/simplepie/simplepie/src/HTTP/FileClient.php
@@ -70,7 +70,7 @@ final class FileClient implements Client
}
if (!$file->success) {
- throw new HttpException($file->error);
+ throw new HttpException($file->error, $file->get_status_code()); // FreshRSS https://github.com/simplepie/simplepie/pull/905
}
return $file;
diff --git a/lib/simplepie/simplepie/src/SimplePie.php b/lib/simplepie/simplepie/src/SimplePie.php
index 73d4ed7bd..89f7624f8 100644
--- a/lib/simplepie/simplepie/src/SimplePie.php
+++ b/lib/simplepie/simplepie/src/SimplePie.php
@@ -1999,7 +1999,7 @@ class SimplePie
$this->status_code = $file->get_status_code();
} catch (HttpException $th) {
$this->check_modified = false;
- $this->status_code = 0;
+ $this->status_code = $th->getCode(); // FreshRSS https://github.com/simplepie/simplepie/pull/905
if ($this->force_cache_fallback) {
$this->data['cache_expiration_time'] = \SimplePie\HTTP\Utils::negociate_cache_expiration_time($this->data['headers'] ?? [], $this->cache_duration, $this->cache_duration_min, $this->cache_duration_max); // FreshRSS
@@ -2093,6 +2093,7 @@ class SimplePie
} catch (HttpException $th) {
// If the file connection has an error, set SimplePie::error to that and quit
$this->error = $th->getMessage();
+ $this->status_code = $th->getCode(); // FreshRSS https://github.com/simplepie/simplepie/pull/905
return !empty($this->data);
}