diff options
Diffstat (limited to 'app/views/helpers/feed/update.phtml')
-rw-r--r-- | app/views/helpers/feed/update.phtml | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index 0d9252910..8390fa6bf 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -421,6 +421,7 @@ <fieldset id="html_xpath"> <?php + /** @var array<string> $xpath */ $xpath = Minz_Helper::htmlspecialchars_utf8($this->feed->attributeArray('xpath') ?? []); ?> <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.help') ?></p> @@ -516,6 +517,7 @@ <fieldset id="json_dotnotation"> <?php + /** @var array<string,string> $jsonSettings */ $jsonSettings = Minz_Helper::htmlspecialchars_utf8($this->feed->attributeArray('json_dotnotation') ?? []); ?> <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.help') ?></p> @@ -634,17 +636,19 @@ </div> <div class="form-group"> + <?php + /** @var array<int,int|string> $curlParams */ + $curlParams = $this->feed->attributeArray('curl_params') ?? []; + ?> <label class="group-name" for="curl_params_cookie"><?= _t('sub.feed.css_cookie') ?></label> <div class="group-controls"> <input type="text" name="curl_params_cookie" id="curl_params_cookie" class="w100" value="<?= - $this->feed->attributeArray('curl_params') !== null && !empty($this->feed->attributeArray('curl_params')[CURLOPT_COOKIE]) ? - $this->feed->attributeArray('curl_params')[CURLOPT_COOKIE] : '' + !empty($curlParams[CURLOPT_COOKIE]) ? $curlParams[CURLOPT_COOKIE] : '' ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" /> <p class="help"><?= _i('help') ?> <?= _t('sub.feed.css_cookie_help') ?></p> <label for="curl_params_cookiefile"> <input type="checkbox" name="curl_params_cookiefile" id="curl_params_cookiefile" value="1"<?= - $this->feed->attributeArray('curl_params') !== null && isset($this->feed->attributeArray('curl_params')[CURLOPT_COOKIEFILE]) ? - ' checked="checked"' : '' + isset($curlParams[CURLOPT_COOKIEFILE]) ? ' checked="checked"' : '' ?> /> <?= _t('sub.feed.accept_cookies') ?> </label> @@ -656,8 +660,7 @@ <label class="group-name" for="curl_params_redirects"><?= _t('sub.feed.max_http_redir') ?></label> <div class="group-controls"> <input type="number" name="curl_params_redirects" id="curl_params_redirects" class="w50" min="-1" value="<?= - $this->feed->attributeArray('curl_params') !== null && !empty($this->feed->attributeArray('curl_params')[CURLOPT_MAXREDIRS]) ? - $this->feed->attributeArray('curl_params')[CURLOPT_MAXREDIRS] : '' + !empty($curlParams[CURLOPT_MAXREDIRS]) ? $curlParams[CURLOPT_MAXREDIRS] : '' ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" /> <p class="help"><?= _i('help') ?> <?= _t('sub.feed.max_http_redir_help') ?></p> </div> @@ -678,8 +681,7 @@ <label class="group-name" for="curl_params_useragent"><?= _t('sub.feed.useragent') ?></label> <div class="group-controls"> <input type="text" name="curl_params_useragent" id="curl_params_useragent" class="w100" value="<?= - $this->feed->attributeArray('curl_params') !== null && !empty($this->feed->attributeArray('curl_params')[CURLOPT_USERAGENT]) ? - $this->feed->attributeArray('curl_params')[CURLOPT_USERAGENT] : '' + !empty($curlParams[CURLOPT_USERAGENT]) ? $curlParams[CURLOPT_USERAGENT] : '' ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" /> <p class="help"><?= _i('help') ?> <?= _t('sub.feed.useragent_help') ?></p> </div> @@ -689,18 +691,14 @@ <label class="group-name" for="proxy_type"><?= _t('sub.feed.proxy') ?></label> <div class="group-controls"> <select name="proxy_type" id="proxy_type"><?php - $type = ''; - if ($this->feed->attributeArray('curl_params') !== null && isset($this->feed->attributeArray('curl_params')[CURLOPT_PROXYTYPE])) { - $type = $this->feed->attributeArray('curl_params')[CURLOPT_PROXYTYPE]; - } + $type = $curlParams[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> <input type="text" name="curl_params" id="curl_params" value="<?= - $this->feed->attributeArray('curl_params') !== null && !empty($this->feed->attributeArray('curl_params')[CURLOPT_PROXY]) ? - $this->feed->attributeArray('curl_params')[CURLOPT_PROXY] : '' + !empty($curlParams[CURLOPT_PROXY]) ? $curlParams[CURLOPT_PROXY] : '' ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" /> <p class="help"><?= _i('help') ?> <?= _t('sub.feed.proxy_help') ?></p> </div> |