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

Fix issue 966 dot array in old() function #969

Merged
merged 3 commits into from
Mar 21, 2018
Merged

Fix issue 966 dot array in old() function #969

merged 3 commits into from
Mar 21, 2018

Conversation

gabriel-pnhr
Copy link
Contributor

Fix issue 966 dot array in old() function

Signed-off-by: Gabriel P [email protected]

helper('array');

// Check for an array value in POST.
if (isset($_SESSION['_ci_old_input']['post']) && dot_array_search($key, $_SESSION['_ci_old_input']['post']))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're doing the dot array search twice here which is inefficient. More inefficient than assigning it to a variable, I believe. Please change that.

}

// Check for an array value in GET.
if (isset($_SESSION['_ci_old_input']['get']) && dot_array_search($key, $_SESSION['_ci_old_input']['get']))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make changes here, also.

@gabriel-pnhr
Copy link
Contributor Author

gabriel-pnhr commented Mar 20, 2018

hum, the coverage check is ok in my fork ... https://github.com/gabpnr/CodeIgniter4/pull/1

@lonnieezell
Copy link
Member

@gabpnr The coverage calculations are a little weird sometimes. Your code is fine. Merging. Thanks!

@lonnieezell lonnieezell merged commit 99c5443 into codeigniter4:develop Mar 21, 2018
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