Fix author search link (#3315)

Before, when clicking on the author link, the search was done on the
main stream in the normal view. It's fine until the feed is not visible
in the main stream.
Now, the current context is used along with the search.

See #3314
This commit is contained in:
Alexis Degrugillier authored and GitHub committed 2021-01-03 00:59:57 +01:00
1 parent 9c6682e7ed
commit 31cb07ac1a
3 files changed
+9 -2

No files matched your search

+1 -1
View File
@@ -88,7 +88,7 @@ $today = @strtotime('today');
echo $first ? _t('gen.short.by_author') . ' ' : '· ';
$first = false;
?>
<em><a href="<?= _url('index', 'index', 'search', 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))) ?>"><?= $author ?></a></em>
<em><a href="<?= Minz_Url::display(Minz_Request::modifiedCurrentRequest(['search' => 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))])) ?>"><?= $author ?></a></em>
<?php endforeach; ?>
</div><?php endif; ?>
</div>
+1 -1
View File
@@ -57,7 +57,7 @@ $content_width = FreshRSS_Context::$user_conf->content_width;
echo $first ? _t('gen.short.by_author') . ' ' : '· ';
$first = false;
?>
<em><a href="<?= _url('index', 'index', 'search', 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))) ?>"><?= $author ?></a></em>
<em><a href="<?= Minz_Url::display(Minz_Request::modifiedCurrentRequest(['search' => 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))])) ?>"><?= $author ?></a></em>
<?php
endforeach;
echo ' — ';
+7
View File
@@ -71,6 +71,13 @@ class Minz_Request {
'params' => self::$params,
);
}
public static function modifiedCurrentRequest(array $extraParams = null) {
$currentRequest = self::currentRequest();
if (null !== $extraParams) {
$currentRequest['params'] = array_merge($currentRequest['params'], $extraParams);
}
return $currentRequest;
}
/**
* Setteurs