-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
scope isolation for user includes #2667
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
Conversation
< 8000 div data-view-component="true">
@@ -15,6 +15,8 @@ function includeIfExists($file) | |||
return file_exists($file) ? include $file : false; | |||
} | |||
|
|||
includeIfExists(__DIR__.'/../src/Composer/Autoload/ClassLoader.php'); |
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.
no need to use includeIfExists
here. It will always exist as it is in the repo.
and no need to use ../src/
as __DIR__
is already the src
folder
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.
Right, fixed
Build fails because of function redefinition. |
Fixed |
@stof You see any issues with this? I don't really see what the big deal with being able to access $this theoretically is, but this is fine by me too. |
It looks fine to me. |
Yeah I think that we can live with, so merging this. |
scope isolation for user includes
*/ | ||
function includeFile() | ||
{ | ||
include func_get_arg(0); |
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.
Err now that I think about it, i forgot to comment on this, why doesn't this function just have a proper parameter?
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.
Guess I can answer that myself, to keep the scope empty :)
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.
exactly
Prevents access to $this/self from included files.