Skip to content

Commit

Permalink
fix search encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Dec 15, 2023
1 parent 2dc79e9 commit 10ba2cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/tests/UrlsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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*"])
);
}
Expand Down
2 changes: 1 addition & 1 deletion core/urls.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function make_link(): string
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");
Expand Down

0 comments on commit 10ba2cc

Please sign in to comment.