summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
Commit message (Collapse)AuthorAgeFilesLines
* Change Zend Stream API to use zend_string* instead of char*.Dmitry Stogov2021-03-161-26/+19
| | | | | This allows to eliminate re-calculation of string lenght and hash value. See the detailed list of changes in UPGRADING.INTERNALS.
* Replace zend_bool uses with boolNikita Popov2021-01-151-10/+10
| | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* Revert "Fix bug #64865: Use CONTEXT_DOCUMENT_ROOT for scanning dir tree"Nikita Popov2020-10-191-5/+2
| | | | | | | This reverts commit 98bfad738ad2734dfba5733323f7ba733daf3ec3. This doesn't work well in some setups, see bug #80113 and GH-5051. Reverting this for now.
* Add stubs for SAPIsMáté Kocsis2020-07-101-18/+3
| | | | Closes GH-5295.
* Remove proto comments from C filesMax Semenik2020-07-061-16/+8
| | | | Closes GH-5758
* Better leak fix for cgi -s / -wNikita Popov2020-06-261-7/+1
| | | | | | We also need to go through request shutdown. The naming is a bit confusing, but it's fine to go through fastcgi_request_done even if not using fastcgi. Whether we loop or not is checked separately.
* Fix leaks in cgi strip/highlight modeNikita Popov2020-06-251-5/+2
|
* Constify char * arguments of APIstwosee2020-06-081-6/+6
| | | | Closes GH-5676.
* Implement #47074: phpinfo() reports "On" as 1 for the some extensionsChristoph M. Becker2020-06-041-8/+8
| | | | What is modified as boolean, should also be displayed as boolean.
* Merge branch 'PHP-7.4'Christoph M. Becker2020-05-121-0/+4
|\ | | | | | | | | * PHP-7.4: Fix #79489: .user.ini does not inherit
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-05-121-0/+4
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #79489: .user.ini does not inherit
| | * Fix #79489: .user.ini does not inheritChristoph M. Becker2020-05-121-0/+4
| | | | | | | | | | | | | | | On Windows, PATH_TRANSLATED may contain backslashes as well as slashes, so we must not only check for `DEFAULT_SLASH`.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-04-201-3/+3
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79491: Search for .user.ini extends up to root dir
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-04-201-3/+3
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79491: Search for .user.ini extends up to root dir
| | * Fix #79491: Search for .user.ini extends up to root dirChristoph M. Becker2020-04-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `start` parameter of `php_cgi_ini_activate_user_config` is supposed to hold the byte offset of the doc root in the given `path`. However, the current expression which fixes a potential type incompatibility will ever only evaluate to zero or one, because it uses the *logical* and operator (`&&`). Furthermore we notice that subtracting one from `doc_root_len` is not necessary, so there is even no need for the `start` parameter at all.
* | | Remove return value from llist apply functionsNikita Popov2020-04-151-3/+2
| | | | | | | | | | | | Unlike the hash apply functions, these do not return int.
* | | Use separate typedef for bucket comparison functionNikita Popov2020-03-041-4/+1
| | | | | | | | | | | | | | | Avoid performing the same casting dance inside each sort compare function.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-01-271-0/+4
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix bug #78323: Code 0 is returned on invalid options
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-01-271-0/+4
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix bug #78323: Code 0 is returned on invalid options
| | * Fix bug #78323: Code 0 is returned on invalid optionsIvan Mikheykin2020-01-271-0/+4
| | | | | | | | | | | | | | | Set CLI exit code to 1 when invalid parameters are passed, and print error to stderr.
| | * Future-proof email addressesZeev Suraski2018-11-011-2/+2
| | |
| | * Trim trailing whitespace in source code filesPeter Kokot2018-10-131-3/+3
| | |
* | | Fix bug #64865: Use CONTEXT_DOCUMENT_ROOT for scanning dir treewbender2020-01-241-2/+5
| | | | | | | | | | | | | | | | | | | | | If CONTEXT_DOCUMENT_ROOT is set use that rather than DOCUMENT_ROOT to scan up the dir tree looking for .user.ini files. Closes GH-5051.
* | | Fix #78880: Another bunch of spelling errorsMáté Kocsis2020-01-161-1/+1
| | |
* | | Use RETURN_THROWS() during ZPP in main, sapi, win32, and ZendMáté Kocsis2019-12-301-3/+3
| | |
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
|/ / | | | | | | Closes GH-4732.
* | Fix bindpath mem leak in cgiDavid Carlier2019-07-241-0/+1
| | | | | | | | Closes GH-4451.
* | Introduce zend_stream_init_filename()Nikita Popov2019-07-161-5/+1
| | | | | | | | Avoid more ad-hoc initialization of zend_file_handle structures.
* | Introduce zend_stream_init_fp() APINikita Popov2019-07-161-6/+3
| | | | | | | | | | Reduce the amount of code that mucks around with zend_file_handle initialization.
* | Move shebang handling into the lexerNikita Popov2019-07-151-72/+1
| | | | | | | | | | | | | | | | | | | | Instead of handling shebang lines by adjusting the file pointer in individual SAPIs, move the handling into the lexer, where this is both a lot simpler and more robust. Whether the shebang should be skipped is controlled by CG(skip_shebang) -- we might want to do that in more cases. This fixed bugs #60677 and #78066.
* | CGI: Fix memory leak on error pathsDavid Carlier2019-07-091-3/+5
| |
* | Use PHP_VERSION for zend modulesPeter Kokot2019-06-091-1/+1
| | | | | | | | Closes #4147
* | Remove checks for locale.h, setlocale, localeconvPeter Kokot2019-04-071-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `<loccale.h>` header file, setlocale, and localeconv are part of the standard C89 [1] and on current systems can be used unconditionally. Since PHP 7.4 requires at least C89 or greater, the `HAVE_LOCALE_H`, `HAVE_SETLOCALE`, and `HAVE_LOCALECONV` symbols defined by Autoconf in configure.ac [2] can be ommitted and simplifed. The bundled libmagic (file) has also been patched already in version 5.35 and up in upstream location so when it will be patched also in php-src the check for locale.h header is still left in the configure.ac and in windows headers definition file. [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.4 [2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4 Omit the bundled libmagic files
* | Remove HAVE_SIGNAL_HPeter Kokot2019-04-071-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `<signal.h>` header file is part of the standard C89 headers [1] and on current systems can be included unconditionally. Since file requires at least C89 or greater, the `HAVE_SIGNAL_H` symbol defined by Autoconf in Zend.m4 [2] can be ommitted and simplifed. The bundled libmagic (file) also ommits the usage of HAVE_SIGNAL_H since 5.35 however current version in PHP is very modified 5.34 version and will be refactored separately. Check for HAVE_SIGNAL_H is therefore still done in the configure.ac. Refs: [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2 [2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
* | Implemented a faster way to access predefined TSRM resources - CG(), EG(), etc.Dmitry Stogov2019-03-141-2/+1
| |
* | Avoid reinitailization of ZTS cache pointer. Initialize it once in TSRM.cDmitry Stogov2019-03-121-1/+3
| |
* | Update and fix remaining year ranges (2019)Peter Kokot2019-02-081-2/+2
| | | | | | | | | | | | This patch follows previous license year ranges updates. With new approach source code files now have simplified headers with license information without year ranges.
* | Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* | Remove yearly range from copyright noticeZeev Suraski2019-01-301-1/+1
| |
* | Replace zend_hash_apply... with ZEND_HASH_FOREACH...Dmitry Stogov2018-12-191-8/+4
| |
* | Future-proof email addresses...Zeev Suraski2018-11-011-2/+2
| |
* | Trim trailing whitespace in source code filesPeter Kokot2018-10-131-3/+3
| |
* | Merge branch 'PHP-7.3'Christoph M. Becker2018-10-081-2/+2
|\ \ | |/ | | | | | | * PHP-7.3: Fix #76954: apache_response_headers removes last character from header name
| * Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2018-10-081-2/+2
| |\ | | | | | | | | | | | | * PHP-7.2: Fix #76954: apache_response_headers removes last character from header name
| | * Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2018-10-081-2/+2
| | |\ | | | | | | | | | | | | | | | | * PHP-7.1: Fix #76954: apache_response_headers removes last character from header name
| | | * Fix #76954: apache_response_headers removes last character from header namestodorovic2018-10-081-2/+2
| | | |
* | | | Merge branch 'PHP-7.3'Anatol Belski2018-10-031-3/+3
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Avoid code duplication and don't miss env restore
| * | | Merge branch 'PHP-7.2' into PHP-7.3Anatol Belski2018-10-031-3/+3
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Avoid code duplication and don't miss env restore
| | * | Merge branch 'PHP-7.1' into PHP-7.2Anatol Belski2018-10-031-2/+2
| | |\ \ | | | |/ | | | | | | | | | | | | * PHP-7.1: Avoid code duplication and don't miss env restore
| | | * Avoid code duplication and don't miss env restoreAnatol Belski2018-10-031-2/+2
| | | |