-
Notifications
You must be signed in to change notification settings - Fork 241
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
EZP-30834: remove strtotime function from the trashed-days option #1441
EZP-30834: remove strtotime function from the trashed-days option #1441
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! $trashedDays
indeed should be an integer with number of days, not a timestamp (
* @param int|null $trashedDays Number of days an object should had been in trash to be purged, use null to use a default value so any object in the trash will be purged. |
That's +1 from me.
PS: Thank you for your contribution!
Please note that the test fails to reasons not related to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! But could you please rebase on 2017.12? We merge forwards from there.
Hi @glye , About the rebase you are asking for. Are you sure about rebase on 2017.12? this branch is kind of 100 commits behind 2019.03 and it does not include any of the work done here: I can also
Does it make sense? Thank you :) |
Merging, indeed this only makes sense on 2019.03 as this is bug fix for new feature added in 2019.03/2.5. |
Beautiful! |
Great. Sorry I missed your answer, @carlosmauri |
* commit 'c49eef93f50c665a3d7a6b2aa6387ccd46e059f5': Removed invalid constructor call Fixed wrong old-style constructor usage EZP-31040: Remote Code Execution in file uploads Show images after used url_prefix (ezsystems#1453) improve php 7 bc doc (ezsystems#1452) Fix notice when checking for anonymous classes in autoload generator (ezsystems#1450) Do not support literal HTML in the Administration Interface (ezsystems#1408) Fix transformURI() on ignoreIndexDir & ! htmlEscape (ezsystems#1449) Make autoloads ignore anonymous classes (ezsystems#1448) Update php7.md Fixing search in media lib which used to loose context (ezsystems#1433) [Travis] Add testing for PHP 7.2 and 7.3 (ezsystems#1446) EZP-30834: remove strtotime function from the trashed-days option (ezsystems#1441) Fix instances of count() that would cause a warning in 7.2 Updated dbupdate scripts so they will no longer fail when there are multiple users with the same e-mail (ezsystems#1445)
On a recent client work we noticed that the trashpurge.php wasn't working as expected.
This PR fix that issue.
Summary:
The following line within the trashpurge.php script:
$options['trashed-days'] ? strtotime( "-{$options['trashed-days']} days" ) : null
Is converting the trashed days into the wrong value.
This is because we already have the same strtotime function in here:
https://github.com/ezsystems/ezpublish-legacy/blob/2019.03/kernel/private/classes/ezscripttrashpurge.php#L88
The commit fix that issue.
More info within the Jira ticket:
JIRA ticket: https://jira.ez.no/browse/EZP-30834
Thanks!