Implement script only include#1111
Implement script only include#1111yohgaki wants to merge 8 commits intophp:masterphp/php-src:masterfrom yohgaki:master-rfc-script-only-includeyohgaki/php-src:master-rfc-script-only-includeCopy head branch name to clipboard
Conversation
There was a problem hiding this comment.
this (32) should be a constant
There was a problem hiding this comment.
I agree. Do you have suggested name? If so, I just use yours.
|
Don't see the move_uploaded_file() part. |
…r max filename extensions
There was a problem hiding this comment.
This may be implemented as ZEND_API in Zend.
|
I found what's wrong in ZTS build. It seems I have to relocate script_extensions array to somewhere accessible. CG is not accessible under ZTS build according to gdb. Where would be the best place to locate script_extensions char array? |
There was a problem hiding this comment.
ah, also seems save_ptr isn't initialized here.
|
I was bored and read through the RFC and I feel like this feature addresses a problem that doesn't exist if the PHP "developer" did their job right. This RFC is merely adding another already implemented feature. Maybe I'm mistaken or missing something, there doesn't seem to be any added value to PHP by implementing this. |
There was a problem hiding this comment.
you're using case sensitive match here. Are you sure it won't break on case-insensitive filesystems?
|
Umm.. not sure if this is the right place but won't it be better to change the behavior to the way other programming languages do it as pointed out in the RFC? As in Just my 2 cents.. :) |
|
RFC vote seems to be declined, can we close this? |
|
@yohgaki 'Just note that it is programmer's problem, if he doesn't write security invulnerable code, not a problem of the language. So 👎 |
https://wiki.php.net/rfc/script_only_include
I used memcmp() to compare file extension. It's better to use strcasecmp for windows, probably. Use #if ?
I also used E_COMPILE_ERROR for now. If it's OK to use E_ERROR/E_RECVERABLE_ERROR in zend_language_scanner.[cl], I'll change.
I'll treat failing tests later.