Fixed: encode umlauts for filter
continuous-integration/drone/push Build is failing Details

This commit is contained in:
philipp lang 2023-03-22 23:37:36 +01:00
parent df178c8186
commit 38d434aef8
4 changed files with 5 additions and 5 deletions

View File

@ -24,7 +24,7 @@ abstract class Filter extends Data
public static function fromRequest(array|string|null $request = null): static
{
$payload = is_string($request)
? json_decode(base64_decode($request), true)
? json_decode(rawurldecode(base64_decode($request)), true)
: $request;
return static::fromPost($payload);

View File

@ -9,7 +9,7 @@ export default {
},
computed: {
filterString() {
return btoa(JSON.stringify(this.inner.meta.filter));
return btoa(encodeURIComponent(JSON.stringify(this.inner.meta.filter)));
},
},
methods: {

View File

@ -192,9 +192,9 @@ class IndexTest extends TestCase
{
$this->withoutExceptionHandling()->login()->loginNami();
$searchResponse = $this->callFilter('member.index', ['search' => 'Max']);
$searchResponse = $this->callFilter('member.index', ['search' => 'Maxö']);
$this->assertInertiaHas('Max', $searchResponse, 'data.meta.filter.search');
$this->assertInertiaHas('Maxö', $searchResponse, 'data.meta.filter.search');
}
public function testItLoadsGroups(): void

View File

@ -20,7 +20,7 @@ trait MakesHttpCalls
public function filterUrl(string $routeName, array $filter): string
{
$params = [
'filter' => base64_encode(json_encode($filter)),
'filter' => base64_encode(rawurlencode(json_encode($filter))),
];
return route($routeName, $params);