mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-01 08:35:17 +02:00
core: Add context hinting for new feeds
RSS-Bridge currently has to guess the queried context from the data provided by the user. This, however, can cause issues for bridges that have multiple contexts with conflicting parameters (i.e. none). This commit adds context hinting to queries via '&context=<context>' which can be omitted in which case the context is determined as before.
This commit is contained in:
parent
e2bca5bb05
commit
1591e18027
3 changed files with 19 additions and 4 deletions
|
@ -48,13 +48,19 @@ final class BridgeCard {
|
|||
* @param bool $isHttps If disabled, adds a warning to the form
|
||||
* @return string The form header
|
||||
*/
|
||||
private static function getFormHeader($bridgeName, $isHttps = false) {
|
||||
private static function getFormHeader($bridgeName, $isHttps = false, $parameterName = '') {
|
||||
$form = <<<EOD
|
||||
<form method="GET" action="?">
|
||||
<input type="hidden" name="action" value="display" />
|
||||
<input type="hidden" name="bridge" value="{$bridgeName}" />
|
||||
EOD;
|
||||
|
||||
if(!empty($parameterName)) {
|
||||
$form .= <<<EOD
|
||||
<input type="hidden" name="context" value="{$parameterName}" />
|
||||
EOD;
|
||||
}
|
||||
|
||||
if(!$isHttps) {
|
||||
$form .= '<div class="secure-warning">Warning :
|
||||
This bridge is not fetching its content through a secure connection</div>';
|
||||
|
@ -80,7 +86,7 @@ This bridge is not fetching its content through a secure connection</div>';
|
|||
$isHttps = false,
|
||||
$parameterName = '',
|
||||
$parameters = array()) {
|
||||
$form = self::getFormHeader($bridgeName, $isHttps);
|
||||
$form = self::getFormHeader($bridgeName, $isHttps, $parameterName);
|
||||
|
||||
if(count($parameters) > 0) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue