Skip to content

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

Merged
dg merged 1 commit into
nette:masterfrom
dg:pull-purge
Feb 20, 2019
Merged

Helper::purge() protection [WIP]#392
dg merged 1 commit into
nette:masterfrom
dg:pull-purge

Conversation

@dg

@dg dg commented Oct 24, 2018

Copy link
Copy Markdown
Member
  • 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

milo commented Oct 29, 2018

Copy link
Copy Markdown
Member

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

Not sure there should be a test for it :)

@milo

milo commented Oct 29, 2018

Copy link
Copy Markdown
Member

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

@dg
dg merged commit bcdd42a into nette:master Feb 20, 2019
@dg
dg deleted the pull-purge branch February 20, 2019 01:45
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants