Commit Graph

6797 Commits

Author SHA1 Message Date
David Soria Parra
fa79f2f46b Fix #55212. Only declare STREAM_PF_INET6 if PHP is compiled with IPv6 support 2011-07-15 15:25:24 +00:00
Pierre Joye
dd1a0be3c0 - Fixed bug #55187, readlink returns weird characters when false result 2011-07-12 15:15:17 +00:00
Kalle Sommer Nielsen
9f782a73e8 Changed http_response_code() to be able to set a response code 2011-07-12 03:56:32 +00:00
Dmitry Stogov
adb87c8d06 Fixed bug #54332 (Crash in zend_mm_check_ptr // Heap corruption) 2011-07-11 09:47:59 +00:00
Ilia Alshanetsky
1a4456bb76 Fixed bug relating to un-initialized memory access 2011-07-05 20:10:45 +00:00
Stanislav Malyshev
01249bb40b fix crypt() issue with overlong salt 2011-07-04 23:38:09 +00:00
Dmitry Stogov
adabdede5e Fixed bug #53727 (Inconsistent behavior of is_subclass_of with interfaces) 2011-07-04 14:55:39 +00:00
Gustavo André dos Santos Lopes
404686447b - Fixed bug #55082 (var_export() doesn't escape properties properly). 2011-06-30 09:26:35 +00:00
Ilia Alshanetsky
b9ffb87960 Fixed test 2011-06-28 23:47:05 +00:00
Stanislav Malyshev
3acd5811ae Fix crypt_blowfish 8-bit chars problem (CVE-2011-2483), add tests
# See details at http://www.openwall.com/lists/announce/2011/06/21/1
2011-06-26 21:34:39 +00:00
Knut Urdalen
c5a4e11bab small fix in disk_total_space() tests (PHP_5_3 already includes this) 2011-06-25 21:22:42 +00:00
Felipe Pena
f9f298cc0b - Missing valid path check 2011-06-23 21:53:25 +00:00
Hannes Magnusson
ffc6da20a0 These are annoyingly slow 2011-06-23 21:27:42 +00:00
Ilia Alshanetsky
34d93f0c06 Zend Signal Handling 2011-06-22 14:23:21 +00:00
Stanislav Malyshev
177612ca4d re-generate credits 2011-06-19 17:56:09 +00:00
Felipe Pena
f417c732a9 - Fix tests 2011-06-19 15:43:16 +00:00
Felipe Pena
868b808f4c - Opss, restore old behavior 2011-06-19 14:50:44 +00:00
Felipe Pena
d8782ddaeb - Added missing void param check in sys_get_temp_dir
- Fixed param check of umask()
2011-06-19 14:27:33 +00:00
Felipe Pena
b9746b0ba6 - Missing usage of 'p' parameter specifier 2011-06-19 13:20:12 +00:00
Felipe Pena
bc6cb0c70d - Fixed bug #54680 (missing TRACK_VARS_SERVER check) 2011-06-12 02:47:48 +00:00
Gustavo André dos Santos Lopes
8d52500d41 - Reverted r301991, which is a (partial) fix to bug #52550, addressing an
overflow in a signed subtraction. This fixes the overflow without
  changing the algorithm.
2011-06-12 00:56:18 +00:00
Felipe Pena
0a0443f07c - Missing fixes for grammar fix 's/valid path/a valid path/' 2011-06-09 00:23:43 +00:00
Ilia Alshanetsky
80f46ca2c5 Fixed test to account for smaller default floating point # precision 2011-06-08 02:03:14 +00:00
Felipe Pena
ddaddf6c2a s/valid path/a valid path/ 2011-06-08 00:53:55 +00:00
Felipe Pena
a641ccb774 - Test fixes 2011-06-07 02:29:03 +00:00
Felipe Pena
d86b3633cf - Test fixes 2011-06-06 22:36:54 +00:00
Felipe Pena
32b5f8a1a3 - Added new parameter parsing option (p - for valid path (string without null byte in the middle))
# The tests will be fixed in the next commits
2011-06-06 21:28:16 +00:00
Hannes Magnusson
eed6bdb5c7 When you write to a symlink - you access the file itself, not the symlink, so we need to compare the atime to the orignal file 2011-06-05 12:08:14 +00:00
Hannes Magnusson
513faa54bb Make sure we are writing more data then the block size 2011-06-05 12:07:11 +00:00
Hannes Magnusson
86209a3919 touch() no longer attempts to create files on empty strings 2011-06-05 09:42:10 +00:00
Philip Olson
45f4c5dd7e Updated the note maintainers credits 2011-06-05 06:57:13 +00:00
Scott MacVicar
0c107d3bf3 Fix Bug #54918 - Crash when there is a failure to read the browscap file 2011-06-03 00:42:07 +00:00
Scott MacVicar
76cbcc7f66 Added fabled hex2bin() function 2011-06-03 00:12:22 +00:00
Gustavo André dos Santos Lopes
ce966baaa4 - Fixed double registering of browscap ini directive. See bug #54896. 2011-06-02 08:46:40 +00:00
Hannes Magnusson
9392b9cd73 Fixed bug #54946 (stream_get_contents infinite loop) 2011-05-29 12:29:19 +00:00
Ilia Alshanetsky
34de2c30c5 Fixed bug #53848 (fgetcsv() ignores spaces at beginnings of fields). 2011-05-29 10:23:06 +00:00
Ilia Alshanetsky
d2b11712ff Fixed bug #54137 (file_get_contents POST request sends additional line break). 2011-05-29 09:23:08 +00:00
Stanislav Malyshev
c16bfe403f MFH: Fixed comilation on x86_64 2011-05-27 19:24:09 +00:00
Ilia Alshanetsky
28edcb949d Fixed bug #54924 (assert.* is not being reset upon request shutdown). 2011-05-26 18:17:43 +00:00
Pierre Joye
d1ea827f27 -fix bug 54935, php_win_err can lead to crash 2011-05-26 14:37:13 +00:00
Felipe Pena
565d4bc695 - Fixed ZTS build and removed unused vars 2011-05-25 22:23:48 +00:00
Stanislav Malyshev
5c9080d3a6 implement streams metadata API per RFC 2011-05-25 21:03:55 +00:00
Philip Olson
f5b67e09b9 Fixed test, as per r311323 2011-05-25 00:02:05 +00:00
Felipe Pena
ad0666eb94 - Fixed bug #50363 (Invalid parsing in convert.quoted-printable-decode filter)
Patch by: slusarz at curecanti dot org
2011-05-24 23:49:26 +00:00
Philip Olson
76ec6924cb Updated test. touch() emits E_WARNING for bogus values. Updated 5.3 test to look the same. 2011-05-24 23:27:49 +00:00
Pierre Joye
59c102bf51 - Fix #54721, different Hashes on Windows, BSD and Linux on wrong Salt size 2011-05-24 13:48:04 +00:00
Michael Wallner
1056c57fa9 MFH: Fix Bug #54727, a re-incarnation of #26862 2011-05-24 05:06:53 +00:00
Stanislav Malyshev
9eb5cb6571 fix some failing tests 2011-05-23 07:06:04 +00:00
Rasmus Lerdorf
f5a9e17f9c Increase the overly conservative pcre backtrack limit from 100000 to 1000000 2011-05-21 19:48:37 +00:00
Felipe Pena
964f44a280 - Fixed bug #54895 (Fix compiling with older gcc version without need for membar_producer macro)
patch by: mhei at heimpold dot de
2011-05-20 21:24:51 +00:00
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
a5eeecb13f Suppress a dozen unused return value warnings in places where the return
value is really not useful to us.
2011-05-16 17:22:41 +00:00
Rasmus Lerdorf
245d15fdc6 Drop support for autoconf < 2.60 in trunk and the
new PHP_5_4 branch. autoconf >= 2.60 should finally
be working now.
2011-05-15 06:09:21 +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
Scott MacVicar
194b48088c Fixed bug #54723 - getimagesize() doesn't check the full ico signature and misreports mpg files 2011-05-13 05:06:48 +00:00
Scott MacVicar
b966897a0d Turns out that more than 1% of users clocks are more than a year out of date, this causes cookies to never get deleted since the date is in the future.
I can only guess its due to batteries on the motherboard being dead.
2011-05-10 19:09:24 +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
Felipe Pena
48cb3447bb - Fixed ZTS build 2011-05-01 19:22:24 +00:00
Gustavo André dos Santos Lopes
6d9d7af86f - Fixed bug #54580 (get_browser() segmentation fault when the browscap ini
directive is set in activation time). This commit fixes this by adding a per
  request parsing of the browscap file that's when get_browser is called the
  first time and the directive is set on activation time.w
2011-05-01 18:37:20 +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
Felipe Pena
07f60310b2 - Remove undesired line (reported by Gökhan Özbulak) 2011-04-13 13:38:52 +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
e65d361fde - Fixed bug #54092 (Segmentation fault when using HTTP proxy with the FTP
wrapper).
#php_stream->wrapperdata should hold an array zval (like its zval* type
#indicates...), it's not a place where the wrapper can drop an arbitrary
#pointer. For that, .wrapperthis should be used.
#Also, since the ftp dir wrapper defines its own stream type, it's more
#appropriate to use .abstract to store the stream instance specific data.
2011-02-27 20:23:54 +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
b21f62eb2d - Removed dead defines. 2011-02-21 05:33:16 +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
Gustavo André dos Santos Lopes
077ee3a879 - Fixed bug #53959 (reflection data for fgetcsv out-of-date). 2011-02-08 16:29:34 +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
426f31e790 - Changed port validation introduced in commit #308035 to consider
negative ports and ports > 65535 as invalid.
  The tests that fail due to #308035 in the standard ext were not
  fixed. If the behavior in those tests turns out to be the
  desirable one, both this commit and #308035 ought to be reverted
  or at least adapted.
2011-02-05 22:37:00 +00:00
Ilia Alshanetsky
109b8e99e0 Fixed bug #53924 (FILTER_VALIDATE_URL doesn't validate port number). 2011-02-04 21:41:15 +00:00
Adam Harvey
2b4fb94e8e Fix bug #53913 (Streams functions assume HAVE_GLOB is defined). Patch by Chris
Jones.
2011-02-04 10:47:41 +00:00
Scott MacVicar
ca378eefa0 Add header_register_callback(), allows a userland function
to be called as all the headers are being sent and after all
of the default headers have been merged.

headers_list(), header_remove() and header() can all be used
inside the callback.

<?php

header('Content-Type: text/plain');
header('X-Test: foo');

function foo() {
  foreach (headers_list() as $header) {
    if (strpos($header, 'X-Powered') !== false) {
      header_remove('X-Powered-By');
    }
    header_remove('X-Test');
  }
}

$result = header_register_callback('foo');
echo "a";
2011-02-03 16:47:28 +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
c6ccc43285 - Fixed several comparisons that always result in true of false
due to signedness of one of the operands, either by removing
  dead code or fixing it.
- Thrown some comments around in php_stream_get_record.
- See http://www.mail-archive.com/internals@lists.php.net/msg49525.html
2011-02-01 18:11:16 +00:00
Dmitry Stogov
aa5055ba0f Added ability to connect to HTTPS sites through proxy with basic authentication using stream_context/http/header/Proxy-Authorization 2011-01-28 10:33:47 +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
Ilia Alshanetsky
78b60fcc97 Fixed compiler warning 2011-01-17 13:44:54 +00:00
Ilia Alshanetsky
a6a4751a88 Fixed variable re-declaration 2011-01-12 13:21:27 +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
Rui Hirokawa
b374b41c6f added an option to http_build_query for RFC-3986
based url-encoding.
2011-01-08 02:21:44 +00:00
Pierre Joye
7b330e0e96 - missing add header 2011-01-07 14:57:51 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Gustavo André dos Santos Lopes
c6af7fc7f4 - Do not violate php_stream abstraction and use php_stream_tell instead of accessing the field .position.
#Should have no behavior changes.
2010-12-30 19:00:19 +00:00
Moriyoshi Koizumi
bbf3d43c1e * Refactor zend_multibyte facility.
Now mbstring.script_encoding is superseded by zend.script_encoding.
2010-12-19 16:36:37 +00:00
Jani Taskinen
ddf42dde2f - Update credits 2010-12-17 10:48:47 +00:00
Jani Taskinen
116e097287 - Revert 2010-12-17 10:43:52 +00:00
Hannes Magnusson
fc146c7352 Throw some credit around 2010-12-17 10:15:21 +00:00
Ilia Alshanetsky
844a58dc3c Fixed compiler warning 2010-12-14 17:01:54 +00:00
Ilia Alshanetsky
1f13d55895 Fixed bug #48607 (fwrite() doesn't check reply from ftp server before exiting) 2010-12-13 16:53:26 +00:00
Gustavo André dos Santos Lopes
52ea9da401 - Fixed bug #53530 (php_crypt tests gcc version incorrectly due to
typo) (vapier at gmail dot com)
2010-12-12 22:27:02 +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
Pierre Joye
a7ffa09e18 - add PHP_INSTALL_HEADERS to all parts (core&exts) exposing headers, generate the install-headers cmd 2010-12-11 22:18:10 +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
Gustavo André dos Santos Lopes
f73258223d - Implemented request #26158/bug #53465 (open arbitrary file descriptor with fopen) 2010-12-11 01:52:13 +00:00
Dmitry Stogov
755c2cd0d8 Removed compile time dependency from ext/mbstring 2010-12-08 11:27:34 +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
Dmitry Stogov
67e8d44aa4 Removed unnecessary dependencies 2010-11-29 08:56:21 +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
Ilia Alshanetsky
8f85ff3dd6 Fixed bug #53304 (quot_print_decode does not handle lower-case hex digits) 2010-11-25 21:38:06 +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
Dmitry Stogov
ab93d8c621 Added multibyte suppport by default. Previosly php had to be compiled with --enable-zend-multibyte. Now it can be enabled or disabled throug zend.multibyte directive in php.ini 2010-11-24 05:41:23 +00:00
Felipe Pena
7c541356f3 - Fixed compile warnings 2010-11-23 21:49:18 +00:00
Ilia Alshanetsky
09b69ee8ad Fixed bug #46587 (mt_rand() does not check that max is greater than min). 2010-11-23 13:09:15 +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
Kalle Sommer Nielsen
1fed0e5a84 Kill some more constness warnings in com_dotnet/phar/standard 2010-11-19 16:03:00 +00:00
Pierrick Charron
71dfe80e05 Remove unused variables 2010-11-17 17:55:18 +00:00
Jani Taskinen
4d13e04ae2 - Fixed wrong type causing crash (in php-cgi -i and phpinfo(); when doing HTML output) 2010-11-17 11:56:48 +00:00
Felipe Pena
0c7c01a480 - Updated QA and User note maintainers credits 2010-11-16 23:02:00 +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
Felipe Pena
565c484222 - Moved leak_variable() to zend_builtin_functions.c (Gustavo) 2010-11-15 17:06:27 +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
3a02cfb675 - Added leak_variable() function.
- Added mechanism to force outer streams to be closed before their inner ones.
- Fixed temp:// streams only handling correctly (through an ad hoc mechanism)  reverse closing order
  when the  inner stream is of type memory.
2010-11-15 03:05:32 +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
Adam Harvey
6cb7ea4089 Implemented FR #53264 (Add fputcsv method to SplFileObject). 2010-11-09 15:07:50 +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
Felipe Pena
5d584d4737 - Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4) 2010-11-01 17:16:47 +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
e69b1ff2c4 - Fixed bug #49687 (utf8_decode vulnerabilities and deficiencies in the number
of reported malformed sequences). (Gustavo)
#Made a public interface for get_next_char/utf-8 in trunk to use in utf8_decode.
#In PHP 5.3, trunk's get_next_char was copied to xml.c because 5.3's
#get_next_char is different and is not prepared to recover appropriately from
#errors.
2010-10-27 18:13:25 +00:00
Ilia Alshanetsky
18fa045e75 Code cleanup & CS 2010-10-25 16:46:55 +00:00
Gustavo André dos Santos Lopes
d46efce418 - A BOM had slipped in a commit and broke the build under GCC. Fixed. 2010-10-24 23:51:40 +00:00
Gustavo André dos Santos Lopes
20e2c5fc33 - Fixed uninitialized and 1 character short local variable. 2010-10-24 21:19:04 +00:00
Gustavo André dos Santos Lopes
03de44f23e - Removed out-of-date comments and one enum constant from html_tables.h and its generator.
- Other minor aesthetic improvements in the generator.
2010-10-24 19:05:21 +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