diff options
| author | 2023-01-26 08:59:34 +0100 | |
|---|---|---|
| committer | 2023-01-26 08:59:34 +0100 | |
| commit | 07efaf71eac19934d858df678576823da131d1bb (patch) | |
| tree | 38cde28b75769272378b0aa3e41047b30901800e /app/Models | |
| parent | 2f027545226eca238a6a80021cb3ac0e60b51696 (diff) | |
Fix error handling when updating URL (#5039)
Fix 3 related error handling when updating the feed URL with an invalid URL. Previously leading to unclear 500 page with additional PHP errors.
Diffstat (limited to 'app/Models')
| -rw-r--r-- | app/Models/Feed.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php index a63c2b3ea..09cacbd61 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -259,13 +259,14 @@ class FreshRSS_Feed extends Minz_Model { } public function _url(string $value, bool $validate = true) { $this->hash = ''; + $url = $value; if ($validate) { - $value = checkUrl($value); + $url = checkUrl($url); } - if ($value == '') { + if ($url == '') { throw new FreshRSS_BadUrl_Exception($value); } - $this->url = $value; + $this->url = $url; } public function _kind(int $value) { $this->kind = $value; |
