summaryrefslogtreecommitdiff
path: root/ext/standard
Commit message (Collapse)AuthorAgeFilesLines
* strtr() optimizationDmitry Stogov2021-03-221-24/+21
|
* Implement enumsIlija Tovilo2021-03-172-8/+126
| | | | | | | | RFC: https://wiki.php.net/rfc/enumerations Co-authored-by: Nikita Popov <nikita.ppv@gmail.com> Closes GH-6489.
* Use zend_string_equals() API instead of strcmp() in various placesGeorge Peter Banyard2021-03-171-1/+1
| | | | Closes GH-6784
* Change Zend Stream API to use zend_string* instead of char*.Dmitry Stogov2021-03-163-17/+19
| | | | | This allows to eliminate re-calculation of string lenght and hash value. See the detailed list of changes in UPGRADING.INTERNALS.
* Revert "Remove some unnecessary explicit header dependencies"Nikita Popov2021-03-161-0/+2
| | | | | | | This reverts commit c386b1fb177ec0dccc840cbec801e69609ced5c3. It looks like at least some of these might be needed for ordering in a clean build?
* Remove some unnecessary explicit header dependenciesNikita Popov2021-03-161-2/+0
| | | | These are now automatically tracked by the build system.
* Merge branch 'PHP-8.0'Christoph M. Becker2021-03-082-1/+42
|\ | | | | | | | | * PHP-8.0: Fix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101
| * Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-03-082-1/+42
| |\ | | | | | | | | | | | | * PHP-7.4: Fix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101
| | * Fix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101manuel2021-03-082-1/+42
| | | | | | | | | | | | | | | | | | Don't wait for further responses after a HTTP 101 (Switching Protocols) response Closes GH-6730.
* | | Explicitly print reference wrappers in debug_zval_dump()Nikita Popov2021-03-043-37/+86
| | | | | | | | | | | | Closes GH-6750.
* | | Loop invariant code motionDmitry Stogov2021-03-041-11/+12
| | |
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-03-031-3/+3
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix test wrt. server.inc changes
| * | Fix test wrt. server.inc changesChristoph M. Becker2021-03-031-3/+3
| | |
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-03-032-13/+31
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix #78719: http wrapper silently ignores long Location headers
| * | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-03-032-13/+31
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix #78719: http wrapper silently ignores long Location headers
| | * Fix #78719: http wrapper silently ignores long Location headersChristoph M. Becker2021-03-032-13/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When opening HTTP streams, and reading the headers, we currently discard header lines longer than `HTTP_HEADER_BLOCK_SIZE` (1024 bytes). While this is not generally forbidden by RFC 7230, section 3.2.5, it is not generally allowed either, since that may change the "message framing or response semantics". We thus fix this by allowing arbitrarily long header lines. Closes GH-6720.
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-03-011-0/+93
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix #80751: Comma in recipient name breaks email delivery
| * | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-03-011-0/+93
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix #80751: Comma in recipient name breaks email delivery
| | * Fix #80751: Comma in recipient name breaks email deliveryChristoph M. Becker2021-03-011-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, `SendText()` simply separates potential email address lists at any comma, disregarding that commas inside a quoted-string do not delimit addresses. We fix that by introducing an own variant of `strtok_r()` which caters to quoted-strings. We also make `FormatEmailAddress()` aware of quoted strings. We do not cater to email address comments, and potentially other quirks of RFC 5322 email addresses, but catering to quoted-strings is supposed to solve almost all practical use cases. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com> Closes GH-6735.
* | | Optimize serializing class namesTyson Andre2021-03-011-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Because of the memcpy, compilers can't infer that ZSTR_LEN (i.e. class_name->len) did not change, so they copy it out of memory into a register for the last two accesses. php_var_serialize_string already does something similar. Closes GH-6734
* | | Optimized object serialization without rebulding properties HashTableDmitry Stogov2021-03-011-0/+51
| | |
* | | Incomplete class may have only single "MAGIC_MEMBER"Dmitry Stogov2021-03-011-0/+1
| | |
* | | Change the order of properties used for var_dump(), serialize(), comparison, ↵Dmitry Stogov2021-03-0110-79/+79
| | | | | | | | | | | | | | | | | | etc. Now properties are ordered according to their layout in zend_object structure.
* | | serialize() optimizationDmitry Stogov2021-02-261-31/+88
| | |
* | | Improve SPL directory and stat() cache using zend_srting* instead of char*Dmitry Stogov2021-02-265-33/+83
| | |
* | | Remove quicktesterGeorge Peter Banyard2021-02-256-229/+401
| | | | | | | | | | | | | | | | | | This is barely used and more of a hinderence than anything else Closes GH-6712
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-251-3/+7
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: crc32 module, clang spurious warning removal.
| * | crc32 module, clang spurious warning removal.David CARLIER2021-02-251-3/+7
| | | | | | | | | | | | Closes GH-6725.
* | | Speed up __sleep() and __wakeup() callsDmitry Stogov2021-02-252-35/+56
| | |
* | | Fixed error messageDmitry Stogov2021-02-249-43/+43
| | |
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-02-221-0/+32
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix #75776: Flushing streams with compression filter is broken
| * | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-221-0/+32
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix #75776: Flushing streams with compression filter is broken
| | * Fix #75776: Flushing streams with compression filter is brokenChristoph M. Becker2021-02-221-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, the `bzip2.compress` filter has the same issue as `zlib.deflate` so we port the respective fix[1] to ext/bz2. Second, there is still an issue, if a stream with an attached compression filter is flushed before it is closed, without any writes in between. In that case, the compression is never finalized. We fix this by enforcing a `_php_stream_flush()` with the `closing` flag set in `_php_stream_free()`, whenever a write filter is attached. This call is superfluous for most write filters, but does not hurt, even when it is unnecessary. [1] <http://git.php.net/?p=php-src.git;a=commit;h=20e75329f2adb11dd231852c061926d0e4080929> Closes GH-6703.
* | | Generate class entries from stubs for com, standard, xmlreader, xmlwriter, ↵Máté Kocsis2021-02-2213-35/+91
| | | | | | | | | | | | | | | | | | xsl, zip, Zend Closes GH-6706
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-02-222-1/+17
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
| * | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-222-1/+17
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
| | * Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLIChristoph M. Becker2021-02-222-1/+17
| | | | | | | | | | | | | | | | | | | | | There is no good reason not to show the credits in text based SAPIs, except for brevity. Thus, we suppress the credits from `php -i`. Closes GH-6710.
* | | Revert "Remove class validation. zend_lookup_class_ex() performs it anyway."Dmitry Stogov2021-02-201-0/+6
| | | | | | | | | | | | | | | | | | This reverts commit 61cf1355fd53b6556f0502510ba3e1efbd04d242. Class name validation is only performed if key is not passed. Here, lc_name is passed as key.
* | | Remove class validation. zend_lookup_class_ex() performs it anyway.Dmitry Stogov2021-02-201-6/+0
| | |
* | | Attempt to fix ↵Dmitry Stogov2021-02-191-9/+40
| | | | | | | | | | | | ext\standard\tests\file\basename_bug66395_variation2-win32.phpt and ext\standard\tests\file\pathinfo_basic1-win32.phpt
* | | Improve basename(). Avoid calling mblen() for ASCII compatible locales.Dmitry Stogov2021-02-191-47/+77
| | |
* | | Initialize property to UNDEF on unserialize overwriteNikita Popov2021-02-182-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UNDEF marker here is important to prevent the creation of a reference to the property currently being overwritten, which would then leak. This fixes oss-fuzz 6029559193534464, which was incorrectly merged into oss-fuzz #30584 (which is reported at https://github.com/google/oss-fuzz/issues/5211).
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-182-2/+12
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Avoid signed integer overflow in substr()
| * | Avoid signed integer overflow in substr()Nikita Popov2021-02-182-2/+12
| | | | | | | | | | | | | | | | | | | | | Perform negation after the (size_t) cast rather than before, so as to avoid a signed integer overflow for PHP_INT_MIN. Fixes oss-fuzz #31069.
* | | Don't use unmangled name if property not foundNikita Popov2021-02-182-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This restores the previous behavior for this case. We'll continue to use the mangled name, even if it does not correspond to a declared property. This also fixes an assertion failure for the case of property overwrite, as the add_new was not guaranteed to be "new" previously. Fixes oss-fuzz #31045.
* | | unserialize() optimization. Omit class name validation before hash lookup, ↵Dmitry Stogov2021-02-171-14/+40
| | | | | | | | | | | | and perform it only before autoloading.
* | | Improved unserialize() performance. Checks for object propery "visibility ↵Dmitry Stogov2021-02-161-104/+178
| | | | | | | | | | | | change" were moved, to be performed only if name/visibility had been really changed.
* | | Deprecate passing null to non-nullable arg of internal functionNikita Popov2021-02-11198-5596/+447
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates passing null to non-nullable scale arguments of internal functions, with the eventual goal of making the behavior consistent with userland functions, where null is never accepted for non-nullable arguments. This change is expected to cause quite a lot of fallout. In most cases, calling code should be adjusted to avoid passing null. In some cases, PHP should be adjusted to make some function arguments nullable. I have already fixed a number of functions before landing this, but feel free to file a bug if you encounter a function that doesn't accept null, but probably should. (The rule of thumb for this to be applicable is that the function must have special behavior for 0 or "", which is distinct from the natural behavior of the parameter.) RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg Closes GH-6475.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-111-2/+3
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fixed bug #80718
| * | Fixed bug #80718Nikita Popov2021-02-111-2/+3
| | |