diff options
| author | 2021-03-09 14:51:09 -0500 | |
|---|---|---|
| committer | 2021-03-09 20:51:09 +0100 | |
| commit | 800a42172db1775aaa76f50446ed914ee0b5a80b (patch) | |
| tree | 630a0cd33480909ce6f3954a24a2c18c6f343238 /app/views | |
| parent | 09b7e87532d030f6a1203a4f0fe5a9746bae694c (diff) | |
Add an option to set a custom user agent to retrieve individual feeds (#3494)
* Add an option to set a custom user agent to retrieve individual feeds
This allows retrieving the original RSS feed when websites use services like FeedBurner.
* Use !== instead of != in subscriptionController.php
* Add proxy and user-agent to subscription/add
Co-authored-by: Georgelemental <georgelemental@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/helpers/feed/update.phtml | 59 | ||||
| -rw-r--r-- | app/views/subscription/add.phtml | 28 |
2 files changed, 63 insertions, 24 deletions
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index 06dc859e1..beb64e5a1 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -328,29 +328,6 @@ </div> <div class="form-group"> - <label class="group-name" for="path_entries"><?= _t('sub.feed.proxy') ?></label> - <div class="group-controls"> - <select class="number" name="proxy_type" id="proxy_type"><?php - $type = ''; - if (is_array($this->feed->attributes('curl_params')) && isset($this->feed->attributes('curl_params')[CURLOPT_PROXYTYPE])) { - $type = $this->feed->attributes('curl_params')[CURLOPT_PROXYTYPE]; - } - foreach(['' => '', 3 => 'NONE', 0 => 'HTTP', 2 => 'HTTPS', 4 => 'SOCKS4', 6 => 'SOCKS4A', 5 => 'SOCKS5', 7 => 'SOCKS5H'] as $k => $v) { - echo '<option value="' . $k . ($type === $k ? '" selected="selected' : '' ) . '">' . $v . '</option>'; - } - ?> - </select> - <div class="stick"> - <input type="text" name="curl_params" id="curl_params" class="extend" value="<?= - is_array($this->feed->attributes('curl_params')) && !empty($this->feed->attributes('curl_params')[CURLOPT_PROXY]) ? - $this->feed->attributes('curl_params')[CURLOPT_PROXY] : '' - ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" /> - </div> - <p class="help"><?= _i('help') ?> <?= _t('sub.feed.proxy_help') ?></p> - </div> - </div> - - <div class="form-group"> <label class="group-name" for="mark_updated_article_unread"><?= _t('conf.reading.mark_updated_article_unread') ?></label> <div class="group-controls"> <label class="checkbox" for="mark_updated_article_unread"> @@ -386,6 +363,42 @@ </div> </div> + <div class="form-group"> + <label class="group-name" for="path_entries"><?= _t('sub.feed.useragent') ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="text" name="curl_params_useragent" id="curl_params_useragent" class="extend" value="<?= + is_array($this->feed->attributes('curl_params')) && !empty($this->feed->attributes('curl_params')[CURLOPT_USERAGENT]) ? + $this->feed->attributes('curl_params')[CURLOPT_USERAGENT] : '' + ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" /> + </div> + <p class="help"><?= _i('help') ?> <?= _t('sub.feed.useragent_help') ?></p> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="path_entries"><?= _t('sub.feed.proxy') ?></label> + <div class="group-controls"> + <select class="number" name="proxy_type" id="proxy_type"><?php + $type = ''; + if (is_array($this->feed->attributes('curl_params')) && isset($this->feed->attributes('curl_params')[CURLOPT_PROXYTYPE])) { + $type = $this->feed->attributes('curl_params')[CURLOPT_PROXYTYPE]; + } + foreach(['' => '', 3 => 'NONE', 0 => 'HTTP', 2 => 'HTTPS', 4 => 'SOCKS4', 6 => 'SOCKS4A', 5 => 'SOCKS5', 7 => 'SOCKS5H'] as $k => $v) { + echo '<option value="' . $k . ($type === $k ? '" selected="selected' : '' ) . '">' . $v . '</option>'; + } + ?> + </select> + <div class="stick"> + <input type="text" name="curl_params" id="curl_params" class="extend" value="<?= + is_array($this->feed->attributes('curl_params')) && !empty($this->feed->attributes('curl_params')[CURLOPT_PROXY]) ? + $this->feed->attributes('curl_params')[CURLOPT_PROXY] : '' + ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" /> + </div> + <p class="help"><?= _i('help') ?> <?= _t('sub.feed.proxy_help') ?></p> + </div> + </div> + <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> <div class="form-group"> <label class="group-name" for="timeout"><?= _t('sub.feed.timeout') ?></label> diff --git a/app/views/subscription/add.phtml b/app/views/subscription/add.phtml index 44b3a8528..8d1dc6d2d 100644 --- a/app/views/subscription/add.phtml +++ b/app/views/subscription/add.phtml @@ -59,9 +59,35 @@ </div> </div> - <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> <legend><?= _t('sub.feed.advanced') ?></legend> <div class="form-group"> + <label class="group-name" for="path_entries"><?= _t('sub.feed.useragent') ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="text" name="curl_params_useragent" id="curl_params_useragent" class="extend" value="" placeholder="<?= _t('gen.short.blank_to_disable') ?>" /> + </div> + <p class="help"><?= _i('help') ?> <?= _t('sub.feed.useragent_help') ?></p> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="path_entries"><?= _t('sub.feed.proxy') ?></label> + <div class="group-controls"> + <select class="number" name="proxy_type" id="proxy_type"><?php + foreach(['' => '', 3 => 'NONE', 0 => 'HTTP', 2 => 'HTTPS', 4 => 'SOCKS4', 6 => 'SOCKS4A', 5 => 'SOCKS5', 7 => 'SOCKS5H'] as $k => $v) { + echo '<option value="' . $k . '">' . $v . '</option>'; + } + ?> + </select> + <div class="stick"> + <input type="text" name="curl_params" id="curl_params" class="extend" value="" placeholder="<?= _t('gen.short.blank_to_disable') ?>" /> + </div> + <p class="help"><?= _i('help') ?> <?= _t('sub.feed.proxy_help') ?></p> + </div> + </div> + + <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> + <div class="form-group"> <label class="group-name" for="timeout"><?= _t('sub.feed.timeout') ?></label> <div class="group-controls"> <input type="number" name="timeout" id="timeout" min="3" max="120" value="" placeholder="<?= _t('gen.short.by_default') ?>" /> |
