fix search encoding
This commit is contained in:
parent
2dc79e9569
commit
10ba2ccb7f
2 changed files with 3 additions and 3 deletions
|
@ -13,11 +13,11 @@ class UrlsTest extends TestCase
|
|||
public function test_search_link()
|
||||
{
|
||||
$this->assertEquals(
|
||||
"/test/post/list/bar+foo/1",
|
||||
"/test/post/list/bar%20foo/1",
|
||||
search_link(["foo", "bar"])
|
||||
);
|
||||
$this->assertEquals(
|
||||
"/test/post/list/cat%2A+rating%3D%5Eq/1",
|
||||
"/test/post/list/cat%2A%20rating%3D%5Eq/1",
|
||||
search_link(["rating=?", "cat*"])
|
||||
);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ class Link
|
|||
function search_link(array $terms = [], int $page = 1): string
|
||||
{
|
||||
if($terms) {
|
||||
$q = urlencode(Tag::caret(Tag::implode($terms)));
|
||||
$q = rawurlencode(Tag::caret(Tag::implode($terms)));
|
||||
return make_link("post/list/$q/$page");
|
||||
} else {
|
||||
return make_link("post/list/$page");
|
||||
|
|
Reference in a new issue