Commit Graph

1844 Commits

Author SHA1 Message Date
Ferenc Kovacs
41533cdee1 fix the test with the removal of the unnecessary newline 2011-05-16 23:33:05 +00:00
Ferenc Kovacs
6b593349cb adding the serialize_precision=100 for the tests, credits to Mats Lindh for reporting it 2011-05-16 23:31:14 +00:00
Ferenc Kovacs
a93c3ddbb7 removing XFAIL as #39863 has already been fixed 2011-05-16 23:28:46 +00:00
Rasmus Lerdorf
d19c366c4a Missed merging this into the new PHP_5_4 branch 2011-05-15 05:21:01 +00:00
Martin Jansen
41dbe39471 MFB: Fixed two failing tests that were caused by arbitrarily chosen
but apparently bogus upper resp. lower limits for mt_rand().
2011-05-14 20:38:47 +00:00
Antony Dovgal
bb2ccc96d3 fix tests 2011-05-04 08:44:14 +00:00
Antony Dovgal
968d49ae65 fix test 2011-05-04 08:28:31 +00:00
Antony Dovgal
354cb67597 fix tests 2011-05-03 11:15:30 +00:00
Gustavo André dos Santos Lopes
93f65cdeac - Fixed bug #54623 (Segfault when when writing to a persistent socket after
closing a copy of the socket).
2011-05-01 03:57:01 +00:00
Stanislav Malyshev
c4a8866abb fix bug #54238 (use-after-free in substr_replace()) 2011-04-13 06:32:41 +00:00
Adam Harvey
187eb235fe Implement FR #54459 (Range function accuracy) by changing the way range()
calculates values when used with floating point bounds/step.
2011-04-06 10:23:06 +00:00
Pierrick Charron
1368364469 Fix common typos in the source code (Reported in Bug #54065)
# External libraries were excluded
# Thanks eitan at eitanadler dot com for the first patch :)
2011-04-03 21:46:52 +00:00
Pierrick Charron
5a8c917c37 Fixed bug #54454 (substr_compare incorrectly reports equality in some cases) 2011-04-03 07:18:27 +00:00
Gustavo André dos Santos Lopes
7f2937223d - Make fclose() actually close stream, even when the resource refcount is > 1.
This reverts the fix for bug #24557.
- Make php_stream_free delete the stream from the resources list, not merely
  decrease its refcount, as a single call to zend_list_delete does.           
#Not worth the risk merging to 5.3. While change #2 may prevent some segfaults,
#a quick and dirty survey to the codebase only showed calls to php_stream_close
#or php_stream_free on streams allocated in the same function, which would have
#refcount == 1. May be reconsidered.
2011-03-21 02:58:54 +00:00
Gustavo André dos Santos Lopes
2034e14341 - Fixed SKIPIF section of bug52820.phpt. 2011-03-20 22:15:43 +00:00
Gustavo André dos Santos Lopes
547a96090f - Fixed bug #54332 (trunk only, null pointer deref due to information loss on long to int conversion)
- Fixed some int* pointers being passed as size_t*.
2011-03-20 15:15:08 +00:00
Pierrick Charron
6e74d95f34 Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment) 2011-03-13 04:02:56 +00:00
Eyal Teutsch
adecc80459 fixed tests to match the new float precision of 53, as described in bug 47168 2011-03-10 13:25:19 +00:00
Gustavo André dos Santos Lopes
2a6968e43a - Fixed bug #54055 (buffer overrun with high values for precision ini
setting).
#This fix (for g/G/k/H modes) is done at a different level than that for the
#modes e/E/f/F, at a bit higher level and therefore with less coverage. I
#chose this because it addresses the problem where it is -- the calling function
#that passes a buffer too small to php_gcvt.
2011-02-21 06:53:24 +00:00
Gustavo André dos Santos Lopes
a3a5157286 - PHP_STREAM_OPTION_WRITE_BUFFER no longer disables the read buffer of a plain
stream when 0 is given as the value.
- PHP_STREAM_OPTION_WRITE_BUFFER no longer changes the chunk size in socket
  streams.
- Added stream_set_chunk_size() function.
- Some signedness fixes.
- Test for commit r308474, now that it's possible to actually test it.
2011-02-19 01:28:37 +00:00
Gustavo André dos Santos Lopes
9bbc114b59 - Classes that implement stream wrappers can define a method called
stream_truncate that will respond to truncation, e.g. through ftruncate.
  Closes feature request #53888.
2011-02-17 00:25:32 +00:00
Gustavo André dos Santos Lopes
257b994fdc - Changed default serialize_precision from 100 to 17, as discussed in internals. 2011-02-08 21:40:51 +00:00
Ilia Alshanetsky
6186c16449 Fixed parse_url() tests to account for port validation 2011-02-06 17:23:57 +00:00
Gustavo André dos Santos Lopes
1f49902999 - Fixed bug #53903 (userspace stream stat callback does not separate the
elements of the returned array before converting them).
2011-02-01 22:55:17 +00:00
Gustavo André dos Santos Lopes
4a946a91e5 - Fixed CHARSET_UNICODE_COMPAT (ISO-8859-1 is compatible in the relevant sense).
- Fixed usage of zend_multibyte_get_internal_encoding (its return cannot be
  cast to char*).
- Change tests to reflect that charset detection now relies on
  internal_encoding, not on current_internal_encoding.
  NOTE: This fixes the changes in rev 306077, but it remains that that change
  introduced a BC break. I assumed it was intentional
2011-01-25 10:57:07 +00:00
Stefan Marr
478e5d1dd0 Added trait_exists() [TRAITS] [DOC]
- also changed class_exists() to return false for traits
- added related tests, and get_declared_traits() tests in ext/s/t/co
2011-01-09 19:57:41 +00:00
Ilia Alshanetsky
9696faa790 Fixed bug 48484 (array_product() always returns 0 for an empty array). 2010-12-12 19:27:04 +00:00
Gustavo André dos Santos Lopes
4fe751e8e4 - Tests and small parsing correction for php://fd wrapper 2010-12-11 02:08:02 +00:00
Felipe Pena
74484db1aa - Fixed test (Eyal Teutsch) 2010-12-04 15:57:08 +00:00
Jani Taskinen
17d1b1310e - Fix test 2010-12-03 16:02:47 +00:00
Adam Harvey
d2263d482d Implement FR #53457 (number_format must support more than one character for
thousands separator).
2010-12-03 10:10:08 +00:00
Gustavo André dos Santos Lopes
22d461df62 - Implemented bug/request #53427 - stream_select doesn't preserve the
keys. This cannot be backported to PHP 5.3 due to a BC break. See
  UPGRADING for more information.
2010-11-30 16:22:48 +00:00
Ilia Alshanetsky
4bc5cac317 Fixed bug #52327 (base64_decode() improper handling of leading padding in strict mode) 2010-11-26 20:59:13 +00:00
Adam Harvey
9a1568c113 Implemented FR #53407 (make scandir()'s directory sorting optional). 2010-11-26 09:52:28 +00:00
Gustavo André dos Santos Lopes
1d5eff07f3 - Fixed bug #53403 (use of unitialized values). Fixes the fix for bug #46587.
- Added test for bug #46587.
2010-11-25 16:44:20 +00:00
Felipe Pena
897f0b4c27 - Fixed extract() to do not overwrite $GLOBALS and $this when using EXTR_OVERWRITE.
patch by: jorto at redhat dot com
2010-11-19 22:06:44 +00:00
Ilia Alshanetsky
5bdb47791a Fixed bug #47168 (printf of floating point variable prints maximum of 40 decimal places). 2010-11-19 16:36:10 +00:00
Felipe Pena
2e42d64007 - Fixed bug #53319 (strip_tags() may strip '<br />' incorrectly) 2010-11-16 22:16:44 +00:00
Gustavo André dos Santos Lopes
e10454ded8 - Fixed bug #52820 (writes to fopencookie FILE* not commited when seeking the
stream).
2010-11-15 18:22:52 +00:00
Gustavo André dos Santos Lopes
c3727cc862 - Added test relative to the fix in rev #305346. 2010-11-15 14:51:26 +00:00
Gustavo André dos Santos Lopes
24636a7e1c - Altered htmlentities19.phpt (now htmlentities24.phpt) to reflect new default encoding
being UTF-8.
- Moved ext/standard/tests/file/htmlentities19.phpt and htmlspecialchars.phpt to the
  proper directory (tests/strings instead of tests/file). htmlentities19.phpt had to
  be renamed in order not to clash with an existing file.
2010-11-15 01:57:16 +00:00
Patrick Allaert
e2e76d40e3 - Fixed tests not passing under windows because of the directory separator
difference (thanks Eyal Teutsch for reporting)
2010-11-08 09:29:15 +00:00
Felipe Pena
83ebbc36a1 - Fixed bug #53248 (rawurlencode RFC 3986 EBCDIC support misses tilde char).
patch by: Justin Martin (frozenfire@php)
2010-11-07 12:59:22 +00:00
Gustavo André dos Santos Lopes
b7d69a4952 - Added CLEAN section to recently committed test. 2010-11-05 01:56:28 +00:00
Gustavo André dos Santos Lopes
0a35133524 - Fixed bug #53241 (stream casting that relies on fdopen/fopencookie fails
with streams opened with, inter alia, the 'xb' mode).
2010-11-05 01:29:08 +00:00
Gustavo André dos Santos Lopes
5c09767d4b - Fixed bug #53198 (changing INI setting "from" with ini_set did not have any
effect)
#Made "from" a proper INI setting and bound it to a global variable.
#Previously, it was simply read from the hash table with the parsed ini file
#by using cfg_get_string (I wonder why this mechanism still exists...)
2010-10-29 15:29:15 +00:00
Gustavo André dos Santos Lopes
91727cb844 - Completed rewrite of html.c. Except for determine_charset, almost nothing
remains.
- Fixed bug on determine_charset that was preventing correct detection in
  combination with internal mbstring encoding "none", "pass" or "auto".
- Added profiles for entity encode/decode for HTMl 4.01, XHTML 1.0, XML 1.0
  and HTML 5. Added the constants ENT_HTML401, ENT_XML1, ENT_XHTML and
  ENT_HTML5.
- htmlentities()/htmlspecialchars(), when told not to double encode, verify
  the correctness of the existenting entities more thoroughly.
  It is checked whether the numerical entity represents a valid unicode code
  point (number is between 0 and 0x10FFFF). If using the flag ENT_DISALLOWED,
  it is also checked whether that numerical entity is valid in selected
  document. In HTML 4.01, all the numerical entities that represent a Unicode
  code point (< U+10FFFFFF) are valid, but that's not the case with other
  document types. If the entity is not valid, & is encoded to &amp;.
  For named entities, the check is also more thorough. While before the only
  check would be to determine if the entity was constituted by alphanumeric
  characters, now it is checked whether that entity is necessarily defined for
  the target document type. Otherwise, & is encoded to &amp;.
- For html_entity_decode(), only valid numerical and named entities (as defined
  above for htmlentities()/htmlspecialchars() + !double_encode) are decoded.
  But there is in this case one additional check. Entities that represent
  non-SGML or otherwise invalid characters are not decoded. Note that, in
  HTML5, U+000D is a valid literal character, but the entity &#x0D is not
  valid and is therefore not decoded.
- The hash tables lazily created for decoding in html_entity_decode() that were
  added recently were substituted by static hash tables. Instead of 1 hash
  table per encoding, there's only one hash table per document type defined in
  terms of unicode code points. This means that for charsets other than UTF-8
  and ISO-8859-1, a conversion to unicode code points is necessary before
  decoding.
- On the encoding side, the ad hoc ranges of entities of the translation
  tables, which mapped (in general) non-unicode code points to HTML entities
  were replaced by three-stage tables for HTML 4 and HTML 5. This mapping
  tables are defined only in terms of unicode code points, so a conversion
  is necessary for charsets other than UTF-8 and ISO-8859-1. Even so, the
  multi-stage table is much faster than the previous method, by a factor
  of 5; the conversion to unicode is a small penalty because it's just a
  simple table lookup.
  XML 1.0/htmlspecialchars() uses a simple table instead of a three-stage
  table.
- Added the flag ENT_SUBSTITUTE, which makes htmlentities()/htmlspecialchars()
  replace the invalid multibyte sequences with U+FFFD (UTF-8) or &#FFFD;
  (other encodings).
- Added the flag ENT_DISALLOWED. Implements FR #52860. Characters that cannot
  appear literally are replaced by U+FFFD (UTF-8) or &#FFFD; (otherwise).
  An alternative implementation would be to encode those characters into
  numerical entities, but that would only work in HTML 4.01 due to limitations
  on the values of numerical entities in other document types. See also the
  effects on htmlentities()/htmlspecialchars() with !double_encode above.
2010-10-24 15:01:02 +00:00
Gustavo André dos Santos Lopes
738be1a003 - Three tests were "broken" by rev #304404, not two. Commit the change
to remaining one.
2010-10-14 19:33:12 +00:00
Gustavo André dos Santos Lopes
bfcb754eae - Fixed get_next_char(), used by htmlentities/htmlspecialchars, accepting
certain ill-formed UTF-8 sequences.
2010-10-14 19:14:06 +00:00
Gustavo André dos Santos Lopes
3943351e6a - [DOC] Reverted rev #304382 and rev #304380, as I figured out a way to
fix the erratic behavior without breaking backwards compatibility. Namely,
  $offset retains SEEK_SET behavior but actually SEEK_CUR is passed to
  _php_stream_seek, if possible, by moving the offset stream->position bytes.
- Addresses bug #53006.
2010-10-14 03:15:15 +00:00