diff --git a/controllers/feed.php b/controllers/feed.php
index 6b5745c5..09af2c26 100644
--- a/controllers/feed.php
+++ b/controllers/feed.php
@@ -129,10 +129,10 @@
// Display form to add one feed
Router\get_action('add', function() {
+ $values = array('download_content' => 0, 'rtl' => 0, 'cloak_referrer' => 0);
+
Response\html(Template\layout('add', array(
- 'values' => array(
- 'csrf' => Model\Config\generate_csrf(),
- ),
+ 'values' => $values + array('csrf' => Model\Config\generate_csrf()),
'errors' => array(),
'nb_unread_items' => Model\Item\count_by_status('unread'),
'menu' => 'feeds',
@@ -158,9 +158,8 @@
}
}
- $values += array('download_content' => 0, 'rtl' => 0, 'cloak_referrer' => 0);
- $url = trim($url);
- $feed_id = Model\Feed\create($url, $values['download_content'], $values['rtl'], $values['cloak_referrer']);
+ $values += array('url' => trim($url), 'download_content' => 0, 'rtl' => 0, 'cloak_referrer' => 0);
+ $feed_id = Model\Feed\create($values['url'], $values['download_content'], $values['rtl'], $values['cloak_referrer']);
if ($feed_id) {
Session\flash(t('Subscription added successfully.'));
@@ -171,10 +170,7 @@
}
Response\html(Template\layout('add', array(
- 'values' => array(
- 'url' => $url,
- 'csrf' => Model\Config\generate_csrf(),
- ),
+ 'values' => $values + array('csrf' => Model\Config\generate_csrf()),
'nb_unread_items' => Model\Item\count_by_status('unread'),
'menu' => 'feeds',
'title' => t('Subscriptions')
diff --git a/templates/add.php b/templates/add.php
index f76f4e4f..7e7b2fe1 100644
--- a/templates/add.php
+++ b/templates/add.php
@@ -17,9 +17,9 @@
= Helper\form_label(t('Website or Feed URL'), 'url') ?>
= Helper\form_text('url', $values, array(), array('required', 'autofocus', 'placeholder="'.t('http://website/').'"')) ?>
- = Helper\form_checkbox('rtl', t('Force RTL mode (Right-to-left language)'), 1, isset($values['rtl']) ? $values['rtl'] : false) ?>
- = Helper\form_checkbox('download_content', t('Download full content'), 1, isset($values['download_content']) ? $values['download_content'] : false) ?>
- = Helper\form_checkbox('cloak_referrer', t('Cloak the image referrer'), 1, isset($values['cloak_referrer']) ? $values['cloak_referrer'] : false) ?>
+ = Helper\form_checkbox('rtl', t('Force RTL mode (Right-to-left language)'), 1, $values['rtl']) ?>
+ = Helper\form_checkbox('download_content', t('Download full content'), 1, $values['download_content']) ?>
+ = Helper\form_checkbox('cloak_referrer', t('Cloak the image referrer'), 1, $values['cloak_referrer']) ?>
= t('Downloading full content is slower because Miniflux grab the content from the original website. You should use that for subscriptions that display only a summary. This feature doesn\'t work with all websites.') ?>