summaryrefslogtreecommitdiff
path: root/main/php_variables.c
Commit message (Collapse)AuthorAgeFilesLines
* Replace zend_bool uses with boolNikita Popov2021-01-151-11/+11
| | | | | | | 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.
* Merge branch 'PHP-7.4'Stanislav Malyshev2020-09-281-1/+3
|\ | | | | | | | | | | | | | | | | * PHP-7.4: Update UPGRADING Update UPGRADING Update NEWS & UPGRADING Do not decode cookie names anymore Fix bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12 bytes IV)
| * Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2020-09-281-1/+3
| |\ | | | | | | | | | | | | | | | | | | | | | * PHP-7.3: Update UPGRADING Update NEWS & UPGRADING Do not decode cookie names anymore Fix bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12 bytes IV)
| | * Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2020-09-281-2/+6
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.2: Update NEWS & UPGRADING Do not decode cookie names anymore Fix bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12 bytes IV)
| | | * Do not decode cookie names anymoreStanislav Malyshev2020-09-261-2/+6
| | | |
* | | | Fix #78236: convert error on receiving variables when duplicate [Christoph M. Becker2020-07-231-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | When an input variable name contains a non matched open bracket, we not only have to replace that with an underscore, but also all following forbidden characters.
* | | | Remove proto comments from C filesMax Semenik2020-07-061-8/+4
| | | | | | | | | | | | | | | | Closes GH-5758
* | | | Add helper APIs for maybe-interned string creationtwosee2020-06-081-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ZVAL_CHAR/RETVAL_CHAR/RETURN_CHAR as a shortcut for using ZVAL_INTERNED_STRING and ZSTR_CHAR. Add zend_string_init_fast() as a helper for the empty string / one char interned string / zend_string_init() pattern. Also add corresponding ZVAL_STRINGL_FAST etc macros. Closes GH-5684.
* | | | Constify char * arguments of APIstwosee2020-06-081-17/+10
| | | | | | | | | | | | | | | | Closes GH-5676.
* | | | Drop unnecessary stdint and inttypes header checksGeorge Peter Banyard2020-04-221-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are always available as of C99. Closes GH-5323 Co-authored-by: "Christoph M. Becker" <cmbecker69@gmx.de>
* | | | Merge branch 'PHP-7.4'Christoph M. Becker2020-02-111-25/+38
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Fix #79254: getenv() w/o arguments not showing changes
| * | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-02-111-24/+43
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.3: Fix #79254: getenv() w/o arguments not showing changes
| | * | Fix #79254: getenv() w/o arguments not showing changesChristoph M. Becker2020-02-111-24/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be able to see changes done only with `SetEnvironmentVariable()`, we have to use `GetEnvironmentStrings()` instead of `environ`, because the latter sees only changes done with `putenv()`. For best backward compatibility we're using `GetEnvironmentStringsA()`; switching to the wide string version likely makes sense for master, though.
* | | | Merge branch 'PHP-7.4'Nikita Popov2020-02-031-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Apply tidy formatting
| * | | Apply tidy formattingNikita Popov2020-02-031-1/+1
| | | | | | | | | | | | | | | | Mostly reindent PHP scripts to spaces.
* | | | Merge branch 'PHP-7.4'Christoph M. Becker2019-12-121-18/+17
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Fix #78929: plus signs in cookie values are converted to spaces
| * | | Fix #78929: plus signs in cookie values are converted to spacesKachalin Alexey2019-12-121-18/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We switch the cookie value parsing function from `php_url_decode()` to `php_raw_url_decode()`, so that cookie values are now parsed according to RFC 6265, section 4.1.1. We also refactor to remove duplicate code without changing the execution flow.
* | | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
|/ / / | | | | | | | | | Closes GH-4732.
* | | Report errors from stream read and write operationsNikita Popov2019-07-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The php_stream_read() and php_stream_write() functions now return an ssize_t value, with negative results indicating failure. Functions like fread() and fwrite() will return false in that case. As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams should not be regarded as error conditions, and be reported as successful zero-length reads/writes instead. The handling of EINTR remains unclear and is internally inconsistent (e.g. some code-paths will automatically retry on EINTR, while some won't). I'm landing this now to make sure the stream wrapper ops API changes make it into 7.4 -- however, if the user-facing changes turn out to be problematic we have the option of clamping negative returns to zero in php_stream_read() and php_stream_write() to restore the old behavior in a relatively non-intrusive manner.
* | | tsrm environment lockJoe Watkins2019-03-291-0/+4
| | |
* | | 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
|/ /
* | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-01-101-0/+2
|\ \ | |/
| * Fixed bug #77439Nikita Popov2019-01-101-0/+2
| |
| * year++Xinchen Hui2018-01-021-1/+1
| |
* | Future-proof email addressesZeev Suraski2018-11-011-1/+1
| |
* | Remove unused Git attributes identPeter Kokot2018-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* | Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized ↵Dmitry Stogov2018-07-041-19/+19
| | | | | | | | | | | | | | destructors. zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places. Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
* | Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-1/+1
| | | | | | | | where we sure about string persistence.
* | Avoid useless checks, using zend_string_efree(), in cases where the string ↵Dmitry Stogov2018-05-081-2/+2
| | | | | | | | is known to be a temporary allocated zend_string.
* | year++Xinchen Hui2018-01-021-1/+1
| |
* | Use cheaper APIXinchen Hui2017-12-181-2/+2
| |
* | typoDmitry Stogov2017-12-121-1/+1
| |
* | Avoid reallocation and double copying of variable names.Dmitry Stogov2017-12-121-33/+67
| |
* | Use interned strings as variable namesDmitry Stogov2017-12-011-1/+3
| |
* | Added "argv" and "argc" as known strings.Dmitry Stogov2017-12-011-8/+8
| | | | | | | | Fixed incorrect "argc" update and corresponding phpdbg test.
* | Intern auto global name strings in first placeDmitry Stogov2017-11-291-7/+7
| |
* | RC manipulation cleanupXinchen Hui2017-11-011-5/+3
|/
* Avoid useless duplicationDmitry Stogov2017-06-211-5/+1
|
* Use interned empty and "one char" strings.Dmitry Stogov2017-05-181-1/+7
|
* Merge branch 'PHP-7.1'Nikita Popov2017-02-251-1/+1
|\
| * Merge branch 'PHP-7.0' into PHP-7.1Nikita Popov2017-02-251-1/+1
| |\
| | * Improve fix for bug #73807Nikita Popov2017-02-251-1/+1
| | | | | | | | | | | | | | | | | | At least on some architectures memmove() on FreeBSD does not short-curcuit if src==dst. Check for it explicitly to avoid quadratic copying.
* | | Arguments array can't make cyclesDmitry Stogov2017-02-031-1/+1
| | |
* | | Merge branch 'PHP-7.1'Nikita Popov2017-02-021-2/+8
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.0' into PHP-7.1Nikita Popov2017-02-021-2/+8
| |\ \ | | |/
| | * Fix bug #73807Nikita Popov2017-02-021-2/+8
| | |
| | * Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
| * | Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
* | | Enable HT RC assertions with escape-hatchNikita Popov2017-01-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | HT functions that modify the array now assert that rc=1. As we don't respect this COW constraint everywhere, either for a good reason or because fixing it would take more work, we provide an escape hatch in the form of HT_ALLOW_COW_VIOLATION(ht). If this macro is called assertions on this ht are disabled. The macro is a no-op in release mode.