diff options
Diffstat (limited to 'app/Controllers/subscriptionController.php')
| -rw-r--r-- | app/Controllers/subscriptionController.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index 4a63d1ee4..f0355a82a 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -118,8 +118,6 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController { $httpAuth = $user . ':' . $pass; } - $cat = intval(Minz_Request::param('category', 0)); - $feed->_ttl(intval(Minz_Request::param('ttl', FreshRSS_Feed::TTL_DEFAULT))); $feed->_mute(boolval(Minz_Request::param('mute', false))); @@ -149,7 +147,7 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController { $proxy_address = Minz_Request::param('curl_params', ''); $proxy_type = Minz_Request::param('proxy_type', ''); $opts = []; - if ($proxy_address !== '' && $proxy_type !== '' && in_array($proxy_type, [0, 2, 4, 5, 6, 7])) { + if ($proxy_type !== '') { $opts[CURLOPT_PROXY] = $proxy_address; $opts[CURLOPT_PROXYTYPE] = intval($proxy_type); } @@ -205,7 +203,7 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController { $feed->_filtersAction('read', preg_split('/[\n\r]+/', Minz_Request::param('filteractions_read', ''))); $feed->_kind(intval(Minz_Request::param('feed_kind', FreshRSS_Feed::KIND_RSS))); - if ($feed->kind() == FreshRSS_Feed::KIND_HTML_XPATH) { + if ($feed->kind() === FreshRSS_Feed::KIND_HTML_XPATH || $feed->kind() === FreshRSS_Feed::KIND_XML_XPATH) { $xPathSettings = []; if (Minz_Request::param('xPathItem', '') != '') $xPathSettings['item'] = Minz_Request::param('xPathItem', '', true); if (Minz_Request::param('xPathItemTitle', '') != '') $xPathSettings['itemTitle'] = Minz_Request::param('xPathItemTitle', '', true); @@ -230,7 +228,7 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController { 'description' => sanitizeHTML(Minz_Request::param('description', '', true)), 'website' => checkUrl(Minz_Request::param('website', '')), 'url' => checkUrl(Minz_Request::param('url', '')), - 'category' => $cat, + 'category' => intval(Minz_Request::param('category', 0)), 'pathEntries' => Minz_Request::param('path_entries', ''), 'priority' => intval(Minz_Request::param('priority', FreshRSS_Feed::PRIORITY_MAIN_STREAM)), 'httpAuth' => $httpAuth, @@ -258,12 +256,18 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController { $url_redirect = array('c' => 'subscription', 'params' => array('id' => $id)); } - if ($feedDAO->updateFeed($id, $values) !== false) { - $feed->_categoryId($cat); + if ($values['url'] != '' && $feedDAO->updateFeed($id, $values) !== false) { + $feed->_categoryId($values['category']); + // update url and website values for faviconPrepare + $feed->_url($values['url'], false); + $feed->_website($values['website'], false); $feed->faviconPrepare(); Minz_Request::good(_t('feedback.sub.feed.updated'), $url_redirect); } else { + if ($values['url'] == '') { + Minz_Log::warning('Invalid feed URL!'); + } Minz_Request::bad(_t('feedback.sub.feed.error'), $url_redirect); } } |
