Commit Graph

36625 Commits

Author SHA1 Message Date
Nikita Popov
c4ab08ac9d Fix invalid zend_string_frees in reflection
zend_lookup_class can share the name
2014-10-12 20:55:51 +02:00
Nikita Popov
471e71537f Remove retval member in spl_dllist
Seems pretty useless, unless I'm missing something?
2014-10-12 20:55:51 +02:00
Tjerk Meesters
ea7604fc9e Merge branch 'PHP-5.6'
* PHP-5.6:
  More fixes for nodelist array access
  - testing for null property read
  - no zval copying if the type is already long
  - memory fix for master
  - use zend_long for offset

Conflicts:
	ext/dom/php_dom.c
2014-10-12 12:55:24 +08:00
Tjerk Meesters
37a685ff2b More fixes for nodelist array access
- testing for null property read
- no zval copying if the type is already long
- memory fix for master
2014-10-12 12:47:58 +08:00
Anatol Belski
6445c4bd48 use php_socket_t instead of int 2014-10-10 19:00:19 +02:00
Nikita Popov
7c5da4607c Fix casts in GD
Using convert_to_* after ZVAL_COPY is unsafe.
2014-10-10 12:23:33 +02:00
Nikita Popov
1577ac146f Drop redundant casting code from ext/filter 2014-10-10 12:14:26 +02:00
Tjerk Meesters
2a765d313e pack(): Use SIZEOF_ZEND_LONG instead of SIZEOF_LONG 2014-10-10 07:20:10 +08:00
Tjerk Meesters
284358b317 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add 64 bit formats to pack() and unpack()
2014-10-10 07:05:36 +08:00
Leigh
63fd969300 Add 64 bit formats to pack() and unpack() 2014-10-09 21:02:42 +01:00
Nikita Popov
df79b9b27a Update get_class_name semantics
* get_class_name is now only used for displaying the class name
   in debugging functions like var_dump, print_r, etc. It is no
   longer used in get_class() etc.
 * As it is no longer used in get_parent_class() the parent
   argument is now gone. This also fixes incorrect parent classes
   being reported in COM.
 * get_class_name is now always required (previously some places
   made it optional and some required it) and is also required
   to return a non-NULL value.
 * Remove zend_get_object_classname. This also fixes a number of
   potential leaks due to incorrect usage of this function.
2014-10-09 20:48:27 +02:00
Dmitry Stogov
0390cde428 Improved VM stack primitives for fast paths. Slow paths are not inlined anymore. 2014-10-09 20:29:02 +04:00
Tjerk Meesters
0a50b250b2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Refactored DOMNodeList array dereferencing implementation

Conflicts:
	ext/dom/nodelist.c
	ext/dom/php_dom.c
2014-10-09 23:32:19 +08:00
Tjerk Meesters
59f39dea66 Refactored DOMNodeList array dereferencing implementation 2014-10-09 23:07:12 +08:00
Dmitry Stogov
2f099478a3 zval must not be converted in place without duplication 2014-10-09 18:34:19 +04:00
Nikita Popov
b09acffc04 Remove PDORow get_class_entry handler 2014-10-09 15:23:14 +02:00
Nikita Popov
9903f16e5c Remove get_class_entry handlers in COM 2014-10-09 14:42:56 +02:00
Nikita Popov
e5e9d8346f Remove zend_get_class_entry function 2014-10-09 14:17:30 +02:00
Nikita Popov
b3a779de68 Remove get_class_entry object handler 2014-10-09 14:08:10 +02:00
Nikita Popov
ee5b30fa19 Remove support for classes without class entries
get_class_entry must be non-NULL and return non-NULL.
2014-10-09 13:58:14 +02:00
Nikita Popov
43f1c94dda Review a few more SEPARATE_ZVAL_IF_NOT_REF usages 2014-10-09 12:51:05 +02:00
Nikita Popov
a3b880364f Directly use zend_string for php_implode/php_explode
Also drop some unnecessary zval separations and copies
2014-10-09 12:05:56 +02:00
Dmitry Stogov
9b0b30272f Copy all the arena allocated data from SHM to process memory at once 2014-10-09 14:01:19 +04:00
Tjerk Meesters
49078a6598 Merge branch 'PHP-5.6'
Conflicts:
	ext/dom/dom_properties.h
	ext/dom/nodelist.c
	ext/dom/php_dom.c
2014-10-09 16:55:15 +08:00
Tjerk Meesters
8a3b41cd39 Merge branch 'pr/846' into PHP-5.6
* pr/846:
  DOMNodeList elements are accessible through array notation
2014-10-09 15:55:10 +08:00
Tjerk Meesters
78156520ae Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated NEWS for #68129
  Updated NEWS for #68129
  Fixed bug #68129
2014-10-09 08:24:58 +08:00
Tjerk Meesters
f92c9b3ced Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS for #68129
  Fixed bug #68129
2014-10-09 08:24:05 +08:00
Tjerk Meesters
d0e51f5ce9 Fixed bug #68129
Empty usernames and passwords are now treated differently from no username or password

For example, empty password:

    ftp://user:@example.org

Empty username:

    ftp://:password@example.org

Empty username and empty password

    ftp://:@example.org
2014-10-09 08:21:30 +08:00
Keyur Govande
9ca16fd809 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add to NEWS
  Add to NEWS
  Fix for bug #68087 (ODBC not reading DATE columns correctly)
2014-10-07 21:23:04 +00:00
Keyur Govande
92f108801e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add to NEWS
  Fix for bug #68087 (ODBC not reading DATE columns correctly)
2014-10-07 21:22:07 +00:00
Keyur Govande
df9078ea55 Fix for bug #68087 (ODBC not reading DATE columns correctly)
Temporary variable indicating column field type ID should be
reset to default for loop iteration (i.e. every column in the
record set. The old buggy code made it persist across all columns
leading to invalid reads from the buffer, if for example a DATE
column was preceded by a VARCHAR column.
2014-10-07 21:17:36 +00:00
Keyur Govande
07e285d880 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add to NEWS
  Fix for bug #68114 (Build fails on OS X due to undefined symbols)
2014-10-07 21:08:33 +00:00
Keyur Govande
bcda6c9392 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add to NEWS
  Fix for bug #68114 (Build fails on OS X due to undefined symbols)
2014-10-07 21:08:18 +00:00
Keyur Govande
648673bffe Fix for bug #68114 (Build fails on OS X due to undefined symbols)
gcc (i686-apple-darwin10-gcc-4.2.1) on OS X cannot link fixed-width
decimals and fails with undefined symbols errors like ___extendsddf.
If configure used gcc for compiling it would notice and mark the
feature HAVE_DECIMAL_FP_SUPPORT as unsupported.
But configure seems to use cc (i686-apple-darwin10-llvm-gcc-4.2)
instead, which doesn't support fixed-width decimals either, but the
code compiles and links just fine. I suspect it may have something
to do with the llvm backend printed in the version.
Lacking the time to debug this further, the patch fixes the issue by
checking the expected output when fixed-width decimal support is
present and correctly implemented.
2014-10-07 20:58:43 +00:00
Leigh
aa679295e4 Merge branch 'PHP-5.6' of https://github.com/php/php-src into gmp-random 2014-10-07 14:25:44 +01:00
Anatol Belski
8d4ee9fbaa remove successive assignment 2014-10-06 11:45:23 +02:00
Tjerk Meesters
82523c0752 Merge branch 'pr/647'
* pr/647: (33 commits)
  zend_uint -> uint32_t
  Fix nesting for *non*-compile-time-resolveable functions See a1a4ba9511 (commitcomment-7414223)
  Add tests for calls to nested, *non*-compile-time-resolveable functions See a1a4ba9511 (commitcomment-7414362)
  Make list of opcodes used for nesting calculation consistent   with `zend_do_convert_call_user_func()` in Zend/zend_compile.c
  Rewrite code to use ZEND_VM_JMP() instead of repeated ZEND_VM_INC_OPCODE() calls
  QA: Simplify code to find matching ZEND_DO_FCALL_BY_NAME CG(context).nested_calls is stored inside the initializer's result.num and inside the finalizer's op2.num, by comparing these we don't need to count manually, and are thus safer from future expansion with specialized opcodes e.g.
  Fix expected fatal error, now is catchable fatal
  Adjust expected fatal error message Now also includes "on [TYPE]" after merge from master
  Check for memory leaks when not using return value
  Adjust expected fatal error message Now also includes "on [TYPE]" after merge from master
  Add tests with arrays as parameters
  Handle ZEND_NEW nesting
  Also verify nesting with dynamically called static methods
  Handle ZEND_INIT_NS_FCALL_BY_NAME nesting
  QA: Refactor: Split tests a bit to make them more comprehendable
  Support nested static calls
  Handle ZEND_EXT_FCALL_END, skipping if necessary Verified with running tests with new "-e" run-tests arg: $ make test TESTS=Zend/tests/*-on-non-objects-*phpt TEST_PHP_ARGS=-e # Tests passed    :   11 (100.0%)
  Add support for PHP's 'extended information for debugger/profiler' mode
  Verify non-CV-operands also work See discussion https://github.com/php/php-src/pull/647#issuecomment-48050551
  Only allocate NULL return value if it's actually used
  ...

Conflicts:
	ext/date/tests/bug67118.phpt
2014-10-06 05:52:43 +08:00
Nikita Popov
a86fd31c8c Regenerate tokenizer data
Also fix the tokenizer_data_gen.sh script after 64bit changes.
2014-10-05 22:09:28 +02:00
Nikita Popov
e756333bbb Remove <% and <script language="php"> tags
As per https://wiki.php.net/rfc/remove_alternative_php_tags.

Removes:
 * <% opening tag
 * %> closing tag
 * <%= short opening tag
 * /<script\s+language\s*=\s*(php|"php"|'php')\s*>/i opening tag
 * /</script>/i closing tag
 * asp_tags ini directive
2014-10-05 21:57:05 +02:00
Anatol Belski
d58b70622a properly export tsrm_strtok_r()
for this particular case fixing phar shared build, but for the
general usage anyway
2014-10-05 13:20:27 +02:00
Dmitry Stogov
7c7b9184b1 Fixed list() behavior inconsistency (string handling is disabled for all cases, ArrayAccess objects handling is enabled for all cases, ZEND_FETCH_DIM_TMP_VAR opcode is renamed into ZEND_FETCH_LIST, ZEND_FETCH_ADD_LOCK flag is removed). 2014-10-05 13:02:58 +04:00
Johannes Schlüter
429e1b45a7 Merge branch 'PHP-5.6' 2014-10-04 20:07:00 +02:00
Johannes Schlüter
79ca53b62b Merge branch 'PHP-5.5' into PHP-5.6 2014-10-04 20:06:44 +02:00
Johannes Schlüter
b386991471 Fix accidental edit in previous commit 2014-10-04 20:06:02 +02:00
Johannes Schlüter
a1347a0190 Merge branch 'PHP-5.6' 2014-10-04 20:00:40 +02:00
Johannes Schlüter
61d29990b4 Merge branch 'PHP-5.5' into PHP-5.6 2014-10-04 20:00:10 +02:00
Johannes Schlüter
136dd53ac2 Fix arginfo 2014-10-04 19:59:21 +02:00
Florian MARGAINE
9680829389 DateTimeZone::getOffset() now accepts a DateTimeInterface
Fixes #68062

Should be backported to PHP-5.6 and PHP-5.5.

Conflicts:
	ext/date/tests/bug67118.phpt
2014-10-04 16:06:04 +01:00
Derick Rethans
0e5f475f5e Merge branch 'PHP-5.5' into PHP-5.6 2014-10-04 15:59:17 +01:00
Derick Rethans
0874ef624c Merge branch 'PHP-5.4' into PHP-5.5 2014-10-04 15:58:40 +01:00
Florian MARGAINE
046c345de5 DateTimeZone::getOffset() now accepts a DateTimeInterface
Fixes #68062
2014-10-04 15:58:24 +01:00
Anatol Belski
e9b2340151 fix asinh delivering -0 when the arg is 0 2014-10-03 22:18:21 +02:00
Nikita Popov
4e33f40445 Fix two date tests
New behavior seems much more reasonable - nothing should be able
to touch the $this value like that.
2014-10-03 22:02:02 +02:00
Anatol Belski
d2161c8104 reveal some newer libcurl features in MINFO 2014-10-03 21:47:00 +02:00
Anatol Belski
1ff094deb4 remove the remains of dsp files handling 2014-10-03 19:38:40 +02:00
Anatol Belski
ea5f6eaf19 fix EX usage 2014-10-03 19:23:34 +02:00
Dmitry Stogov
bd9a234645 Replaced EG(This) and EX(object) with EX(This).
Internal functions now recieves zend_execute_data as the first argument.
2014-10-03 19:32:46 +04:00
Remi Collet
26a5627cc6 only no_NO.ISO-8859-1 have to be ignored (merged) 2014-10-01 10:15:13 +02:00
Remi Collet
3e6f176733 only no_NO.ISO-8859-1 have to be ignored 2014-10-01 10:14:14 +02:00
krakjoe
7cbd8f8b8a remove bogus locale use from test 2014-10-01 10:12:06 +02:00
Remi Collet
bd8d73ff45 Merge branch 'PHP-5.6'
* PHP-5.6:
  use $PHP_LIBDIR instread of "lib" in skel example
2014-10-01 09:27:18 +02:00
Remi Collet
f584b67eaa Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  use $PHP_LIBDIR instread of "lib" in skel example
2014-10-01 09:26:46 +02:00
Remi Collet
7319298ffe use $PHP_LIBDIR instread of "lib" in skel example 2014-10-01 09:26:21 +02:00
Nikita Popov
67a11b61cd Drop unused INIT_STRING opcode
INIT_STRING has been implemented as an UNUSED op1 to ADD_* for
some time now.
2014-09-29 22:59:57 +02:00
Nikita Popov
142a01db92 Fix a couple compile warnings 2014-09-29 20:57:17 +02:00
Anatol Belski
e46187daf5 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test filename
2014-09-29 20:31:02 +02:00
Anatol Belski
df4d559881 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test filename
2014-09-29 20:30:43 +02:00
Anatol Belski
7f1239232e fix test filename 2014-09-29 20:30:18 +02:00
Anatol Belski
a81a392117 Merge branch 'PHP-5.6'
* PHP-5.6:
  one more test to illustrate transfer of an arbitrary data amount throug pipes
2014-09-29 20:19:51 +02:00
Anatol Belski
cc3849f039 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  one more test to illustrate transfer of an arbitrary data amount throug pipes
2014-09-29 20:19:31 +02:00
Anatol Belski
1a2a8c6d4e one more test to illustrate transfer of an arbitrary data amount throug pipes 2014-09-29 20:18:33 +02:00
Anatol Belski
6090c3cf83 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix tests on linux
  better test cleanup
2014-09-29 18:13:16 +02:00
Anatol Belski
70ff3ad7d1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix tests on linux
  better test cleanup
2014-09-29 18:12:56 +02:00
Anatol Belski
859913f6d4 fix tests on linux 2014-09-29 18:12:25 +02:00
Anatol Belski
91d3cd8559 better test cleanup
and even force the XFAIL to fail as it would take too long anyway, even if it passes
2014-09-29 18:11:06 +02:00
Anatol Belski
78e23758b7 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fixed bug #51800 proc_open on Windows hangs forever

Conflicts:
	main/streams/plain_wrapper.c
2014-09-29 16:30:40 +02:00
Anatol Belski
87a37f4090 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #51800 proc_open on Windows hangs forever
2014-09-29 16:27:33 +02:00
Anatol Belski
0c982798e0 Fixed bug #51800 proc_open on Windows hangs forever
This loop can block for some minutes, theoretically. Practially
however, this is a 99% non issue for a normal use case. This is
required because read() is synchronous. The PHP streams API wants
to fill its internal buffers, therefore it might try to read some
more data than user has demanded. Also, for a case where we want
to read X bytes, but neither enough data nor EOF arrives, read()
will block until it could fill the buffer. If a counterpart station
runs slowly or delivers not all the data at once, read() would
still be waiting. If we quit too early, we possibly could loose
some data from the pipe. Thus it has to emulate the read()
behaviour, but obviously not completely, just to some grade.

Reading big data amount is for sure an issue on any platforms, it
depends on the pipe buffer size, which is controlled by the system.
On Windows, the buffer size seems to be way too small, which causes
buffer congestion and a dead lock. It is essential to read the pipe
descriptors simultaneously and possibly in the same order as the
opposite writes them.

Thus, this will work with smaller buffer data sizes passed through
pipes. As MSDN states, anonymous pipes don't support asynchronous
operations. Neither anonymous pipes do support select() as they are
not SOCKETs but file descriptors. Consequently - bigger data sizes
will need a better solution based on threads. However it is much
more expencive. Maybe a better solution could be exporting a part
of the internal doing as a userspace function which could perform
some kind of lookahead operation on the pipe descriptor.

This is just the first stone, depending on the user feedback we
might go for further improvements in this area.
2014-09-29 16:24:34 +02:00
Stanislav Malyshev
3fd8a76f26 Merge branch 'PHP-5.6'
* PHP-5.6:
  Set an LDAP error code when failing ldap_bind due to null bytes

Conflicts:
	ext/ldap/ldap.c
2014-09-28 12:28:30 -07:00
Stanislav Malyshev
a8e84b1b21 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Set an LDAP error code when failing ldap_bind due to null bytes
2014-09-28 12:25:49 -07:00
Stanislav Malyshev
ef39f40445 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Set an LDAP error code when failing ldap_bind due to null bytes
2014-09-28 12:25:24 -07:00
Matthew Daley
fcbe20d357 Set an LDAP error code when failing ldap_bind due to null bytes
Some applications check a LDAP link's error code after seeing ldap_bind
fail due to a null byte bind attempt and hence incorrectly receive the
last set error code.

Fix by setting an LDAP error code before returning in this case.
2014-09-28 12:23:52 -07:00
Nikita Popov
bb0c142156 Drop support for GMP 4.1
* Consistent base conversion support (max: 62)
 * mpz_remroot always available
 * Use gmp_randinit_mt instead of LCG
2014-09-28 20:46:22 +02:00
Leigh
581c86c07f Make gmp_setbit and gmp_clrbit return values consistent 2014-09-28 20:18:14 +02:00
Anatol Belski
4b3e198023 removed *.dsw and *.dsp files 2014-09-28 19:02:09 +02:00
Nikita Popov
5bd34be604 Opcache compatibility for coalesce operator 2014-09-28 12:31:52 +02:00
vagrant
5c6ca24dc0 Merge branch 'master' into catchable-fatals/methods-on-non-objects 2014-09-27 17:49:54 +00:00
Florian MARGAINE
9469db9311 DOMNodeList elements are accessible through array notation
Fixes #67949
2014-09-27 01:27:46 +02:00
Derick Rethans
06a9a74d17 Merge branch 'PHP-5.6' 2014-09-26 16:27:09 +01:00
Derick Rethans
71c39612d5 Merge branch 'PHP-5.5' into PHP-5.6 2014-09-26 16:27:05 +01:00
Derick Rethans
5d299509b4 Merge branch 'PHP-5.4' into PHP-5.5 2014-09-26 16:27:00 +01:00
Derick Rethans
16e2d954fc - Updated to version 2014.8 (2014h) 2014-09-26 16:26:59 +01:00
Stanislav Malyshev
408b172017 Revert xp_ssl.c to the state of 5.4.32 due to regressions 2014-09-26 00:44:24 -07:00
Remi Collet
ed59fa3a0d Fixed bug #68103 Dupplicate entry in Reflection (merged) 2014-09-26 09:28:02 +02:00
Remi Collet
97cab239d7 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  Fixed bug #68103 Dupplicate entry in Reflection
2014-09-26 09:06:51 +02:00
Remi Collet
efa7f87de4 Fixed bug #68103 Dupplicate entry in Reflection
$ php -r '$r=new ReflectionExtension("pthreads"); print_r($r->getClassNames());'
Array
(
    [0] => Threaded
    [1] => stackable
    [2] => Thread
    [3] => Worker
    [4] => Mutex
    [5] => Cond
    [6] => Collectable
    [7] => Pool
)

In getClasses() output, it is possible to compare key (ex "stackable")
with $obj->name (ex "Threaded") to detect class alias.

...
    [Threaded] => ReflectionClass Object
        (
            [name] => Threaded
        )
    [stackable] => ReflectionClass Object
        (
            [name] => Threaded
        )
...
2014-09-26 08:56:42 +02:00
Dmitry Stogov
bd76544e15 Fixed optimizer bug 2014-09-26 01:37:33 +04:00
Timm Friebe
e83580c1f0 Merge branch 'master' into catchable-fatals/methods-on-non-objects 2014-09-25 19:45:05 +02:00
Leigh
adf8f0f284 Address issues raised by @nikic
- Thread safety on rand init function.
 - Ret false on validation failure
 - Add _dep of temp_a to temp_b
 - Special case int sized min values
 - More tests!
2014-09-24 22:01:09 +01:00
Ferenc Kovacs
702829dff5 Merge branch 'PHP-5.6'
* PHP-5.6:
  update the certificate used for the test, as it expired recently
2014-09-24 13:42:32 +02:00
Ferenc Kovacs
d27f3e7b64 update the certificate used for the test, as it expired recently 2014-09-24 13:40:52 +02:00
Nikita Popov
75860fa8e1 Fix counting of "R:" references in serialize() 2014-09-24 12:06:19 +02:00
Remi Collet
d3bb0ba39f Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Fix bug #68074 Allow to use system cipher list instead of hardcoded value
2014-09-24 10:36:58 +02:00
Remi Collet
0d776ef87b Fix bug #68074 Allow to use system cipher list instead of hardcoded value 2014-09-24 10:34:55 +02:00
Leigh
3e9a31748d Make sure min < max 2014-09-24 07:56:46 +01:00
Leigh
acd7fcf55f Mersenne Twister was added in GMP 4.2 2014-09-23 23:16:26 +01:00
Dmitry Stogov
58a41cf795 Make QM_ASSIGN, JMP_SET and CAST return IS_TMP_VAR. 2014-09-24 01:57:40 +04:00
Leigh
31e27fc89a Add test files 2014-09-23 22:54:40 +01:00
Leigh
831bb9260c Add gmp_random_bits(bits) and gmp_random_range(min, max) 2014-09-23 22:12:23 +01:00
Leigh
3d6d863ccb Change GMPs default PRNG to Mersenne Twister
Since we don't allow users to seed the RNG, there is no BC issue with changing the generator.
2014-09-23 19:51:56 +01:00
Dmitry Stogov
06103d65b1 Use zval_ptr_dtor_nogc() to free IS_TMP_VAR operands.
Removed ZEND_SWITCH_FREE opcode (ZEND_FREE used instead).
2014-09-23 17:21:29 +04:00
Dmitry Stogov
7cef08c5d1 Allocate copies of internal functions inherited in user classes at CG(arena), instead of permanent heap (malloc). 2014-09-23 12:35:42 +04:00
Dmitry Stogov
1e831439a5 Make internal function names to be interned strings 2014-09-23 12:35:16 +04:00
Nikita Popov
8be73f2650 Fix tests/serialize/bug64146.phpt
The var hash now retains a reference to its elements, to ensure
that addresses are not reused.

Furthermore the var hash now only stores objects and references
and directly uses their pointer as key, thus making serialization
about two times faster.
2014-09-22 23:48:31 +02:00
Dmitry Stogov
d244d3bbf1 Fixed typo 2014-09-23 01:04:47 +04:00
Nikita Popov
483697617f Remove php_varname_check
This is a leftover from PHP < 5.4.

Also removed the php_create_empty_class declaration, which no longer
exists.
2014-09-22 18:34:40 +02:00
Anatol Belski
0885e4b1b9 simplify the condition 2014-09-22 09:41:53 +02:00
Nikita Popov
a770d29df7 Add smart_str_append for appending zend_strings
Also replaces usages in Zend/ and ext/standard
2014-09-21 20:58:31 +02:00
Nikita Popov
2a7de9fdbb Rename smart_str_append to smart_str_append_smart_str
It's used only rarely and I'm running out of append names...
2014-09-21 20:49:39 +02:00
Nikita Popov
e33f3d3b7c Move smart_str implementation into Zend/
So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
2014-09-21 20:49:39 +02:00
Ard Biesheuvel
90fcf0f52a Merge branch 'PHP-5.6' 2014-09-20 16:42:31 -07:00
Ard Biesheuvel
8312836c74 Merge branch 'PHP-5.5' into PHP-5.6 2014-09-20 16:42:12 -07:00
Ard Biesheuvel
7958793342 Merge branch 'PHP-5.4' into PHP-5.5 2014-09-20 16:40:02 -07:00
Ard Biesheuvel
e64da8c20d Fixed bug #66242 (don't assume char is signed)
This fixes a bug in libmagic where a cast to 'char' is assumed to result
in sign extension to occur. However, unqualified 'char' is unsigned on
architectures such as ARM, so the cast needs to be to 'signed char'
explicitly.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2014-09-20 16:39:48 -07:00
Anatol Belski
b9677d313d avoid strlen usage in loop 2014-09-20 20:05:27 +02:00
Anatol Belski
132cd8be0d Merge branch 'pull-request/805'
* pull-request/805:
  Removes accidentally added files.
  Reverts some unwanted changes
  Deletes patch leftovers
  Replaces php5 with php7, without whitespace changes.
2014-09-20 19:46:44 +02:00
Florian MARGAINE
8ad996da17 Reverts some unwanted changes 2014-09-20 18:24:38 +02:00
Anatol Belski
763bfb4f3b refixed printf fmt, used portable macros 2014-09-20 15:46:19 +02:00
Anatol Belski
1b3569235a forked bug41655 test for windows 2014-09-20 15:14:31 +02:00
Florian MARGAINE
8eb7e7bf7f Merge branch 'master' into issue-67910
Conflicts:
	README.PARAMETER_PARSING_API
	ext/gmp/tests/001.phpt
2014-09-20 10:09:21 +02:00
Florian MARGAINE
58ed832fc9 Deletes patch leftovers 2014-09-20 10:03:54 +02:00
Florian MARGAINE
cf0303e782 Replaces php5 with php7, without whitespace changes. 2014-09-20 10:01:44 +02:00
Anatol Belski
3abeb2c8e1 reduce the struct size by 8 byte on 64 bit 2014-09-20 01:43:04 +02:00
Nikita Popov
0cd982f15c Make header C++ compatible 2014-09-19 23:54:58 +02:00
Nikita Popov
31e842472f Make number printing functions less generic
Now that zend_ulong is 64bit on 64bit platforms, it should be
sufficient to always use it, rather than supporting multiple
types.

API changes:
 * _zend_print_unsigned_to_buf and _zend_print_signed_to_buf
   no longer exist.
 * smart_str(ing)_print_long and smart_str(ing)_print_unsigned
   no longer exist.
 * Instead of all these, zend_print_ulong_to_buf and
   zend_print_long_to_buf should be used.
 * smart_str_append_generic_ex no longer exists.
 * smart_str(ing)_append_off_t(_ex) no longer exists, use
   smart_str(ing)_append_long(_ex) instead.
2014-09-19 23:39:07 +02:00
Nikita Popov
ad3e1830ba Use append_unsigned instead of append_long where appropriate 2014-09-19 23:39:07 +02:00
Nikita Popov
37aaccad7d Use inline functions for most of smart_str
smart_str_free_ex no longer exists, always use smart_str_free instead.

smart_str_alloc no longer requires a newlen variable to be in scope,
instead it returns the new length.
2014-09-19 23:39:07 +02:00
Nikita Popov
070667de8d Remove SMART_STR_USE_REALLOC 2014-09-19 23:39:07 +02:00
Anatol Belski
f6c02239ca Merge branch 'PHP-5.6'
* PHP-5.6:
  fix possible array underflow

Conflicts:
	ext/standard/image.c
2014-09-19 20:15:56 +02:00
Anatol Belski
6213d9fc91 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix possible array underflow
2014-09-19 20:13:46 +02:00
Anatol Belski
5d9403f56c fix possible array underflow
there are multiple issues with this code

- php_stream_read() returns an unsigned val, so is >= 0
- if it read less than sizeof(a) bytes, the function operates on garbage
- result->channels is an unsigned val, so >= 0
2014-09-19 20:12:24 +02:00
Anatol Belski
2be8fdcfd6 updated the comment to charset_hint 2014-09-19 19:45:38 +02:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
469c9bdb39 simplify condition 2014-09-19 16:30:01 +02:00
Dmitry Stogov
bccc653185 Avoid double IS_INTERNED() check 2014-09-19 17:32:50 +04:00
Dmitry Stogov
3bc8a958c5 Fixed useless or duplicated IS_INTERNED() checks 2014-09-19 15:41:01 +04:00
Anatol Belski
d8de53d498 avoid unnecessary strlen calls in loop 2014-09-19 12:36:23 +02:00
Anatol Belski
ede6eca2b2 fix signed/unsigned warning and add a note 2014-09-19 12:00:41 +02:00
Anatol Belski
9b7d255cd9 fix condition 2014-09-19 11:42:44 +02:00
Anatol Belski
bf7203e1e0 fix empty string check 2014-09-19 11:23:23 +02:00
Anatol Belski
953386edfd fix an always true condition and improve the error check 2014-09-19 10:33:01 +02:00
Anatol Belski
bae92295fd remove useless condition 2014-09-19 10:09:37 +02:00
Anatol Belski
79bb2a1474 fix conditions 2014-09-19 09:49:32 +02:00
Anatol Belski
6fab907920 there can be only one ... of the identical expressions 2014-09-19 09:26:07 +02:00
Anatol Belski
f25f672916 fix condition 2014-09-19 09:09:20 +02:00
Anatol Belski
4d60f23630 fix printf format 2014-09-19 08:44:35 +02:00
Anatol Belski
571537afe0 remove useless check 2014-09-19 08:35:01 +02:00
Anatol Belski
55d5bace0e more usages for ZEND_SECURE_ZERO() 2014-09-19 01:59:55 +02:00
Anatol Belski
c45f4f5461 generalized the case with secure memory zeroing 2014-09-19 01:46:14 +02:00
Anatol Belski
adf753159b remove useless condition 0 > unsigned 2014-09-19 00:06:40 +02:00
Anatol Belski
4722d85c1e zero sensitive data more secure way 2014-09-19 00:06:38 +02:00
Anatol Belski
bb89ac8408 zero sensitive data more secure way 2014-09-19 00:06:37 +02:00
Anatol Belski
732c49b433 fix sprintf format 2014-09-19 00:06:35 +02:00
Anatol Belski
2b77a57d88 zero sensitive data more secure way 2014-09-19 00:06:34 +02:00
Anatol Belski
3fa5064173 remove useless check 2014-09-19 00:06:32 +02:00
Anatol Belski
6beb91c202 avoid repeated strlen usage 2014-09-19 00:06:30 +02:00
Nikita Popov
8a9dd4a1d7 Fix GMP serialization
Also fix same issue in PDO.
2014-09-18 23:03:27 +02:00
Anatol Belski
c18902d902 reduce struct size by 8 byte on 64 bit 2014-09-17 09:17:34 +02:00
Anatol Belski
42fca62326 improve empty string check 2014-09-17 09:16:59 +02:00
Anatol Belski
2ace2d1b8a reduce struct size by 8 byte on 64 bit 2014-09-17 09:16:00 +02:00
Anatol Belski
efc12d468c reduce the struct size by 8 byte on 64 bit 2014-09-17 09:10:26 +02:00
Anatol Belski
19f8217113 reduce struct size by 8 byte on 64 bit 2014-09-17 09:03:47 +02:00
Anatol Belski
d41ac22a54 avoid strlen() usage in the loop 2014-09-17 08:59:19 +02:00
Anatol Belski
d594809f27 fix printf fmt 2014-09-17 00:56:42 +02:00
Anatol Belski
dda7a01480 fix signed/unsigned mismatch 2014-09-17 00:56:40 +02:00
Anatol Belski
f2e728616c fix signed/unsigned mismatch warnings 2014-09-17 00:56:38 +02:00
Dmitry Stogov
551ee4165b Use runtime-cache to avoid hash lookups in BIND_GLOBAL instruction 2014-09-17 00:52:45 +04:00
Anatol Belski
7ba43ea052 fix signed/unsigned mismatch 2014-09-16 22:15:27 +02:00
Anatol Belski
8c4ab0d02e fix signed/unsigned mismatch 2014-09-16 21:17:27 +02:00
Anatol Belski
fc6f7bfcf3 fix signed/unsigned mismatch 2014-09-16 21:17:25 +02:00
Anatol Belski
5777aa51d9 fix signed/unsigned mismatch 2014-09-16 21:17:24 +02:00
Anatol Belski
95132bee40 redo the fix casting to size_t 2014-09-16 21:17:21 +02:00
Anatol Belski
49a6b485a0 redo the fix casting to size_t where applicable 2014-09-16 21:17:19 +02:00
Anatol Belski
db24742f01 fixed type 2014-09-16 21:17:18 +02:00
Anatol Belski
fba6e5a8cb fix signed/unsigned mismatch warnings 2014-09-16 21:17:16 +02:00
Anatol Belski
8240255e37 fixed signed/unsigned mismatch warning 2014-09-16 21:17:15 +02:00
Dmitry Stogov
f469dc7429 Improve opcache.fast_shutdown 2014-09-16 15:28:46 +04:00
Matteo Beccati
2508ce7aef Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed freetype test on multiple environments
2014-09-16 10:23:03 +02:00
Matteo Beccati
24ed330a22 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed freetype test on multiple environments
2014-09-16 10:22:49 +02:00
Matteo Beccati
b8470e19e4 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed freetype test on multiple environments
2014-09-16 10:22:34 +02:00
Matteo Beccati
00525b824a Fixed freetype test on multiple environments
Some environments, apparently regardless to the freetype version, output 155, while others 156. I guess we can accept both ;)

This reverts commit 592df89027.
2014-09-16 10:19:29 +02:00
Nikita Popov
079409bbc2 Switch (un)mangle property name to size_t and zend_string
Also use the _ex variants where possible.
2014-09-16 00:31:27 +02:00
Anatol Belski
8b2f15551d fix signed/unsigned mismatch warnings 2014-09-15 19:46:33 +02:00
Anatol Belski
066d39020b fix types 2014-09-15 19:46:32 +02:00
Anatol Belski
e591c78d09 revamp serialization to work with size_t for Serializable 2014-09-15 19:46:28 +02:00
Anatol Belski
172ca172d1 correct fix to the natcmp_ex
Till now the actualy length diff between the strings was under
circumstances returned. Whereby for a compare function only return
values of (1, 0, -1) make sense. Thus the old behavior isn't
present anymore, natcmp_ex now behaves as a standard compare function.
2014-09-15 12:58:46 +02:00
Anatol Belski
4c496a7f5b fix signature 2014-09-15 11:30:25 +02:00
Anatol Belski
e056d52acf fix type 2014-09-15 11:30:23 +02:00
Anatol Belski
140d99b467 fix condition 2014-09-15 11:30:22 +02:00
Anatol Belski
d65ead6471 fix type 2014-09-15 10:43:39 +02:00
Anatol Belski
32c46f44a8 avoid strlen usage in the loop 2014-09-15 00:39:55 +02:00
Anatol Belski
635a23128b better way to check for empty string 2014-09-14 22:07:38 +02:00
Anatol Belski
a7482fd2bf make xml_utf8_ encode/decode work with size_t 2014-09-14 21:38:46 +02:00
Anatol Belski
ad9dc75150 avoid strlen() usage in loop 2014-09-14 17:00:06 +02:00
Anatol Belski
29f8b21cd7 fix int overflow preserving the old behavior 2014-09-14 16:39:25 +02:00
Nikita Popov
ebc6da5628 zend_get_property_info takes a zend_string* now 2014-09-14 16:18:08 +02:00
Anatol Belski
734d0b6bfd use nice way to achieve the property name length 2014-09-14 15:09:54 +02:00
Anatol Belski
454548e440 make it safer for an array underrun 2014-09-14 15:03:52 +02:00
Anatol Belski
b6b376efe5 avoid repeated strlen() usage 2014-09-14 12:59:31 +02:00
Anatol Belski
f1ba5389cd reduce struct size by 8 bytes on 64 bit 2014-09-14 12:32:38 +02:00
Anatol Belski
0b40abf41d avoid repeated strlen() usage 2014-09-14 12:30:01 +02:00
Anatol Belski
cbf530c7c0 fix possible pointer truncation 2014-09-14 12:18:52 +02:00
Anatol Belski
8d075b6e4d better way to zero away sensitive data
memset could be optimized away by the compiler
2014-09-14 11:48:51 +02:00
Anatol Belski
041302a8f7 reduce struct size by 8 byte on 64 bit 2014-09-14 11:36:11 +02:00
Anatol Belski
a9c188fbc6 reduce struct size by 8 byte on 64 bit 2014-09-14 11:26:17 +02:00
Anatol Belski
101adecbcd reduce struct sizes by 8 bytes each on 64 bit 2014-09-14 11:13:17 +02:00
Anatol Belski
34e39783b1 remove useless casts and checks 2014-09-14 11:00:22 +02:00
Anatol Belski
77137b56b8 align 4 byte to the start of the word 2014-09-14 10:27:00 +02:00
Anatol Belski
ea4ab02446 fix conditions
substraction from an unsigned
2014-09-14 10:24:10 +02:00
Anatol Belski
65100a6474 reduce the struct size by 8 byte on 64 bit 2014-09-14 09:40:56 +02:00
Anatol Belski
27d0cfb8a7 reduce the struct size by 8 byte on 64 bit 2014-09-14 09:25:09 +02:00
Anatol Belski
273763dd63 reduce the struct size by 8 byte on 64 bit 2014-09-14 09:22:02 +02:00
Anatol Belski
cac71ecc93 reduce the struct size by 8 byte on 64 bit 2014-09-14 01:22:55 +02:00
Anatol Belski
35a2937e6b reduce the struct size by 8 byte on 64 bit 2014-09-14 01:12:12 +02:00
Anatol Belski
b056859d17 reduce the struct size by 8 byte on 64 bit 2014-09-14 00:59:46 +02:00
Anatol Belski
79f51bd1a0 use the generator to produce the header 2014-09-14 00:43:58 +02:00
Anatol Belski
da10603ec9 update the html table generator 2014-09-14 00:42:48 +02:00
Anatol Belski
26cf7df133 removed the emalloc result check, out of memory will bailout 2014-09-14 00:00:52 +02:00
Anatol Belski
7d194a0e0b replaced the check with assert as it's kinda unusual case 2014-09-13 23:57:53 +02:00
Anatol Belski
87a5aae166 removed extra 1 byte member, padding will be done anyway by the compiler 2014-09-13 23:55:30 +02:00
Anatol Belski
49e78dd022 reduce struct size by 8 byte on 64 bit 2014-09-13 23:34:08 +02:00
Anatol Belski
760c51a644 avoid usage of strlen() in the loop 2014-09-13 23:21:53 +02:00
Anatol Belski
a32e493d84 reduce struct size by 8 byte on 64 bit 2014-09-13 23:21:52 +02:00
Anatol Belski
2c66a8c53e better align reduce the struct size by 8 byte on 64 bit 2014-09-13 23:21:51 +02:00
Anatol Belski
58177c27d6 reduce the struct size (under circumstances) on 64 bit 2014-09-13 23:21:49 +02:00
Anatol Belski
a7690fea7a check if the winver was indeed fetched 2014-09-13 23:21:48 +02:00
Anatol Belski
bce562b75e check emalloc() result 2014-09-13 23:21:47 +02:00
Anatol Belski
e00d48490b better way to check for an empty string 2014-09-13 23:21:46 +02:00
Anatol Belski
f357628fc9 reduce the union size from 24 to 16 bytes on 64 bit 2014-09-13 23:21:44 +02:00
Anatol Belski
be9408f71a fix condition
comparsion of two unsigned
2014-09-13 23:21:43 +02:00
Anatol Belski
47fb7a46ac reduced struct sizes by 8 byte each on 64 bit 2014-09-13 23:21:39 +02:00
Anatol Belski
d578e351a9 fix condition
substraction of two unsigned
2014-09-13 23:21:38 +02:00
Anatol Belski
5092c5490a reduce struct sizes by 8 byte on 64 bit 2014-09-13 23:21:37 +02:00
Anatol Belski
1f9893d0ef avoid strlen() usage in the loop 2014-09-13 23:21:36 +02:00
Anatol Belski
98aeef6fac reduced the struct size by 8 byte on 64 bit 2014-09-13 12:49:10 +02:00
Anatol Belski
f8d75839aa reduce the struct size by 8 byte on 64 bit 2014-09-12 23:27:55 +02:00
Anatol Belski
e251ecb6e9 fix possible null ptr deref 2014-09-12 22:31:02 +02:00
Anatol Belski
7ac5a36a2f fix possible nullptr derefrence 2014-09-12 22:18:06 +02:00
Anatol Belski
5257ac4925 fix test which fails if prevous run cleanup failed 2014-09-12 21:35:24 +02:00
Anatol Belski
95a50f7322 fix type 2014-09-12 21:35:23 +02:00