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 Flashdata time comparison for PHP 8 #6013

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

1stwebdesigns
Copy link
Contributor

In PHP 8, string to number comparison works differently (see https://www.php.net/manual/en/migration80.incompatible.php)

This means that Flashdata now no longer clears after each request, and instead persists indefinitely. The author of the Session library helpfully left a comment stating that the string 'old' < time() which under PHP 8 is no longer the case.

@sapics
Copy link
Contributor

sapics commented Jan 16, 2021

It looks same as #6007.

@1stwebdesigns
Copy link
Contributor Author

Sorry, didn't notice that. However that PR seems to address multiple things, and the one for the Flash data check isn't quite correct

@narfbg narfbg added the Bug label Feb 4, 2021
@narfbg narfbg added this to the 3.1.12 milestone Feb 4, 2021
@narfbg narfbg merged commit 119ebee into bcit-ci:develop Feb 4, 2021
narfbg added a commit that referenced this pull request Feb 4, 2021
narfbg added a commit that referenced this pull request Feb 4, 2021
Fix Flashdata time comparison for PHP 8
narfbg added a commit that referenced this pull request Feb 4, 2021
narfbg added a commit that referenced this pull request Feb 4, 2021
@gxgpet gxgpet mentioned this pull request Feb 4, 2021
FireGUI pushed a commit to FireGUI/firegui_client_developers that referenced this pull request Dec 7, 2021
FireGUI pushed a commit to FireGUI/firegui_client_developers that referenced this pull request Dec 17, 2021
@AMoktar
Copy link

AMoktar commented Oct 15, 2022

So, how to fix it ?

@rickyromansyah2045
Copy link

Yes, why you fix it?

@shyju93
Copy link

shyju93 commented Nov 16, 2022

This is an issue in newer version of php . You can fix it by replacing line 420 in system/libraries/Session/Session.php:
elseif ($value < $current_time)
with
elseif ($value === 'old' || $value < $current_time)

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

Successfully merging this pull request may close these issues.

6 participants