summaryrefslogtreecommitdiff
path: root/main/php_variables.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | Apply tidy formattingNikita Popov2020-02-031-1/+1
| | | | | | | | Mostly reindent PHP scripts 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.
* | 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.
* | | Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
| | |
* | | further normalizations, uint vs uint32_tAnatol Belski2016-11-261-1/+1
|/ / | | | | | | | | | | fix merge mistake yet one more replacement run
* | Ensure symtable exists before checking itNikita Popov2016-09-281-1/+2
| |
* | Merge branch 'PHP-7.0'Stanislav Malyshev2016-07-191-0/+18
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.0: (27 commits) fix #72519, possible OOB using imagegif fix #72512, invalid read or write for palette image when invalid transparent index is used Apparently some envs miss SIZE_MAX Fix tests Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment Partial fix for bug #72613 - do not allow reading past error read Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c Fix for bug #72558, Integer overflow error within _gdContributionsAlloc() Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE update NEWS Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders Fix bug #72562 - destroy var_hash properly Fix bug #72551 and bug #72552 - check before converting size_t->int Fix bug #72541 - size_t overflow lead to heap corruption Fix bug #72533 (locale_accept_from_http out-of-bounds access) Fix fir bug #72520 Fix for bug #72513 Fix for bug #72513 CS fix and comments with bug ID ... Conflicts: ext/standard/basic_functions.c
| * Merge branch 'PHP-5.6' into PHP-7.0Stanislav Malyshev2016-07-191-0/+18
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-5.6: fix #72519, possible OOB using imagegif fix #72512, invalid read or write for palette image when invalid transparent index is used Apparently some envs miss SIZE_MAX Fix tests Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c Fix for bug #72558, Integer overflow error within _gdContributionsAlloc() Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE Fix bug #72562 - destroy var_hash properly Fix bug #72533 (locale_accept_from_http out-of-bounds access) Fix fir bug #72520 Fix for bug #72513 Fix for bug #72513 CS fix and comments with bug ID Fix for HTTP_PROXY issue. 5.6.24RC1 add tests for bug #72512 Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access Fixed bug #72479 - same as #72434 Conflicts: Zend/zend_virtual_cwd.c ext/bz2/bz2.c ext/exif/exif.c ext/session/session.c ext/snmp/snmp.c ext/standard/basic_functions.c main/SAPI.c main/php_variables.c
| | * Merge branch 'PHP-5.5' into PHP-5.6Stanislav Malyshev2016-07-191-18/+37
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-5.5: fix #72519, possible OOB using imagegif fix #72512, invalid read or write for palette image when invalid transparent index is used Apparently some envs miss SIZE_MAX Fix tests Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c Fix for bug #72558, Integer overflow error within _gdContributionsAlloc() Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE Fix bug #72562 - destroy var_hash properly Fix bug #72533 (locale_accept_from_http out-of-bounds access) Fix fir bug #72520 Fix for bug #72513 CS fix and comments with bug ID Fix for HTTP_PROXY issue. add tests for bug #72512 Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access Fixed bug #72479 - same as #72434 Conflicts: ext/bz2/bz2.c main/SAPI.c main/php_variables.c
| | | * CS fix and comments with bug IDStanislav Malyshev2016-07-121-2/+3
| | | |
| | | * Fix for HTTP_PROXY issue.Stanislav Malyshev2016-07-101-19/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following changes are made: - _SERVER/_ENV only has HTTP_PROXY if the local environment has it, and only one from the environment. - getenv('HTTP_PROXY') only returns one from the local environment - getenv has optional second parameter, telling it to only consider local environment
| | | * Bump yearXinchen Hui2015-01-151-1/+1
| | | |
* | | | Removed a surplus condition in php_register_variable_ex()Valentin V. Bartenev2016-07-051-1/+1
| | | | | | | | | | | | | | | | The test for equality to " " implies that the character isn't NUL.
* | | | Implemented RFC: Fix inconsistent behavior of $this variableDmitry Stogov2016-06-161-0/+19
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit bdd3b6895c3ce3eacfcf7d4bf4feb8dfa61801fd Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Jun 16 00:19:42 2016 +0300 Fixed GOTO VM commit 2f1d7c8b89ce821086d357cf65f629f040a85c03 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 21:01:57 2016 +0300 Removed unused variable commit cf749c42b0b1919f70b1e7d6dcbfff76899506af Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 19:06:16 2016 +0300 Protection from $this reassign through mb_parse_str() commit 59a9a6c83c66b666971e57f1173b33a422166efd Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 18:14:50 2016 +0300 Added type inference rule for FETCH_THIS opcode commit 73f8d14a856f14a461430b3c7534ab2ce870cbf6 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 18:11:18 2016 +0300 Restored PHP-7 behavior of isset($this->foo). It throws exception if not in object context. Removed useless opcode handlers. commit fa0881381e8ae97e022ae5d1ec0851c952f33c82 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 31 12:25:47 2016 +0300 Changed "Notice: Undefined variable: this" into "Exception: Using $this when not in object context". commit e32cc528c0f2c97963d8ec83eff0269f1f45af18 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 24 02:02:43 2016 +0300 Throw exception on attempt to re-assign $this through extract() and parse_str(). commit 41f1531b52113ec8a4c208aa6b9ef50f1386bb3f Author: Dmitry Stogov <dmitry@zend.com> Date: Mon May 23 22:18:36 2016 +0300 Fixed inconsistent $this behavior
* | | Merge branch 'PHP-5.6' into PHP-7.0Lior Kaplan2016-01-011-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-5.6: Happy new year (Update copyright to 2016)
| * | Happy new year (Update copyright to 2016)Lior Kaplan2016-01-011-1/+1
| | |
* | | Removed or simplified incorrect SEPARATE_*() macros usage.Dmitry Stogov2015-09-291-1/+1
| | |