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

Helper::purge() protection [WIP] #392

Merged
merged 1 commit into from Feb 20, 2019
Merged

Helper::purge() protection [WIP] #392

merged 1 commit into from Feb 20, 2019

Conversation

@dg
Copy link
Member

dg commented Oct 24, 2018

  • new feature?
  • BC break? no
  1. Prevents an incorrect call with an empty parameter (eg due to a typo in the code), which can lead to the whole disc being deleted

  2. Disables purge('/') or `purge('c:/') just for sure

@milo

This comment has been minimized.

Copy link
Member

milo commented Oct 29, 2018

Hope you didn't discover that on your own PC.

Not sure there should be a test for it :)

@milo

This comment has been minimized.

Copy link
Member

milo commented Oct 29, 2018

Maybe run this check after realpath(dirname($dir)) to prevent . or .. misusing too.

@dg dg merged commit bcdd42a into nette:master Feb 20, 2019
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.01%) to 87.258%
Details
@dg dg deleted the dg:pull-purge branch Feb 20, 2019
dg added a commit that referenced this pull request Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.