Skip to content
New issue

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

Preserve numeric keys. #182

Merged
merged 1 commit into from
Nov 20, 2023
Merged

Preserve numeric keys. #182

merged 1 commit into from
Nov 20, 2023

Conversation

alxlnk
Copy link
Contributor

@alxlnk alxlnk commented Nov 17, 2023

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues unknown

array_unshift not preserve numeric keys.

@mikehaertl
Copy link
Collaborator

It has been a while since I've worked on this. So could you give a quick example what this change fixes (including before/after result)?

@alxlnk
Copy link
Contributor Author

alxlnk commented Nov 20, 2023

For example:
I have page with numeric keys https://localhost/en/?105=1&5=1 then when i remove en from url (https://localhost/?105=1&5=1) url manager must redirect to same page back (https://localhost/en/?105=1&5=1).
But if use array_unshift i have wrong url https://localhost/en/?1=1&2=1.
actual behavior:

array(4) {
  [0]=>
  string(10) "site/index"
  ["language"]=>
  string(2) "en"
  [1]=>
  string(1) "1"
  [2]=>
  string(1) "1"
}

need:

array(4) {
  [0]=>
  string(10) "site/index"
  ["language"]=>
  string(2) "en"
  [105]=>
  string(1) "1"
  [5]=>
  string(1) "1"
}

@mikehaertl
Copy link
Collaborator

Hmm, ok, first time I see numeric keys used in a query, TBH. But change should be safe. Merging.

@mikehaertl mikehaertl merged commit 3f360b9 into codemix:master Nov 20, 2023
10 checks passed
@mikehaertl
Copy link
Collaborator

1.8.1 released. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants