We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, after upgrading from 0.6.2 to 0.8.3 we notice following errors and warning into our logs
/app/vendor/membrane/membrane/src/OpenAPI/Filter/QueryStringToArray.php:66
"Warning: Undefined array key 4"
"[\"/app/vendor/membrane/membrane/src/Processor/Field.php:70\",\"/app/vendor/membrane/membrane/src/Processor/BeforeSet.php:42\",\"/app/vendor/membrane/membrane/src/Processor/FieldSet.php:184\",\"/app/vendor/membrane/membrane/src/Processor/FieldSet.php:128\",\"/app/vendor/membrane/membrane/src/OpenAPI/Processor/Request.php:96\",...]"
/app/vendor/membrane/membrane/src/OpenAPI/Filter/QueryStringToArray.php:70
"strtok(): Argument #1 ($string) must be of type string, null given"
"[\"/app/vendor/membrane/membrane/src/OpenAPI/Filter/QueryStringToArray.php:70\",\"/app/vendor/membrane/membrane/src/Processor/Field.php:70\",\"/app/vendor/membrane/membrane/src/Processor/BeforeSet.php:42\",\"/app/vendor/membrane/membrane/src/Processor/FieldSet.php:184\",\"/app/vendor/membrane/membrane/src/Processor/FieldSet.php:128\",\"/app/vendor/membrane/membrane/src/OpenAPI/Processor/Request.php:96,...]"
As far as I can see it issue is in here https://github.com/membrane-php/membrane-core/blob/main/src/OpenAPI/Filter/QueryStringToArray.php#L59
it should be wrapped with array_values like this
$tokens = array_values(array_filter(explode('&', rawurldecode($value)), fn($p) => $p !== ''));
this is what I get in dump if I don't wrap it
array:5 [ 0 => "filter=all" 1 => "page=1" 2 => "per-page=40" 3 => "query=B" 5 => "sort-by=phone:asc" ]
part of url: filter=all&page=1&per-page=40&query=B%26&sort-by=phone%3Aasc
filter=all&page=1&per-page=40&query=B%26&sort-by=phone%3Aasc
The text was updated successfully, but these errors were encountered:
Your Url has a double && in it one url encoded and one not. query=B**%26&**sort-by=phone%3Aasc which would allow you to solve this issue.
query=B**%26&**sort-by=phone%3Aasc
It is a bug though, if you want to put a PR in I'll merge it; otherwise I'll get to it myself when I've got a bit of spare time
Sorry, something went wrong.
here: #198 😄
No branches or pull requests
Hello, after upgrading from 0.6.2 to 0.8.3 we notice following errors and warning into our logs
/app/vendor/membrane/membrane/src/OpenAPI/Filter/QueryStringToArray.php:66
"Warning: Undefined array key 4"
"[\"/app/vendor/membrane/membrane/src/Processor/Field.php:70\",\"/app/vendor/membrane/membrane/src/Processor/BeforeSet.php:42\",\"/app/vendor/membrane/membrane/src/Processor/FieldSet.php:184\",\"/app/vendor/membrane/membrane/src/Processor/FieldSet.php:128\",\"/app/vendor/membrane/membrane/src/OpenAPI/Processor/Request.php:96\",...]"
/app/vendor/membrane/membrane/src/OpenAPI/Filter/QueryStringToArray.php:70
"strtok(): Argument #1 ($string) must be of type string, null given"
"[\"/app/vendor/membrane/membrane/src/OpenAPI/Filter/QueryStringToArray.php:70\",\"/app/vendor/membrane/membrane/src/Processor/Field.php:70\",\"/app/vendor/membrane/membrane/src/Processor/BeforeSet.php:42\",\"/app/vendor/membrane/membrane/src/Processor/FieldSet.php:184\",\"/app/vendor/membrane/membrane/src/Processor/FieldSet.php:128\",\"/app/vendor/membrane/membrane/src/OpenAPI/Processor/Request.php:96,...]"
As far as I can see it issue is in here https://github.com/membrane-php/membrane-core/blob/main/src/OpenAPI/Filter/QueryStringToArray.php#L59
it should be wrapped with array_values like this
$tokens = array_values(array_filter(explode('&', rawurldecode($value)), fn($p) => $p !== ''));
this is what I get in dump if I don't wrap it
array:5 [ 0 => "filter=all" 1 => "page=1" 2 => "per-page=40" 3 => "query=B" 5 => "sort-by=phone:asc" ]
part of url:
filter=all&page=1&per-page=40&query=B%26&sort-by=phone%3Aasc
The text was updated successfully, but these errors were encountered: