Commit Graph

181 Commits

Author SHA1 Message Date
Xinchen Hui
47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Arpad Ray
8b6a2d257a Fix hash key length in register/remove_user_shutdown_function 2011-11-11 14:42:18 +00:00
Michael Wallner
849e7ae7aa Fix Bug #55801 Behavior of unserialize has changed:
(un)serialize in __wakeup/__sleep now use clean var_hashes
2011-10-19 10:09:24 +00:00
Arpad Ray
45a96e0d5b fix zts break in r316688 2011-09-13 23:07:08 +00:00
Arpad Ray
5bc97c6cfa Implement object-oriented session handlers (https://wiki.php.net/rfc/session-oo) 2011-09-13 22:28:15 +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
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
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +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
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
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
7aa43a8d83 - Revamp of the decoding portion of html.c.
- Dramatic improvements on the performance of html_entity_decode and htmlspecialchars_decode, as the
  string is now traversed only once. Speedups of 20 to 25 times with Windows release builds and a
  ~250 characters string (for 2nd and subsequent calls).
- Consistent behavior on html_entity_decode. For instance, the entity in "&&lt;" would be decoded,
  but not "&&#233;". Not anymore. The code path for "basic" and non-basic entities is now mostly
  shared.
- Code of html_entity_decode and htmlspecialchars_decode is now shared.
- [DOC] More consistent behavior of htmlspecialchars_decode. Instead of translating only &lt;, &gt;,
  &amp;, &quot;, &#039; and &#39;, now e.g. &#34;, &apos;, &#0039;, &#x27;, etc. are also decoded.
- [DOC] Previous translation of unicode code points in numerical entities was seriously broken. When
  the code points for some character were not the same in unicode and the target encoding, the
  behavior could be an erroneous translation (e.g. 0x80-0xA0 in win-1252) or no translation at all.
  Added unicode translation tables for all single-byte encodings. Entities are not translated for
  multi-byte entities, except for ASCII characters whose code points are shared. We could add
  the huge translation tables (several thousand elements) for those encodings in the future.
- Fixed numerical entities that after # had text accepted by strcol being accepted.
- Much more commented and well-structured code...
- Tests for get_html_translation_table()) are broken. I stared fixing the tests, but then I realized
  it was completely helpless because get_html_translation_table() is broken by not handling
  multi-byte characters correctly.
2010-10-10 19:04:59 +00:00
Michael Wallner
89e93723fb Added support for object references in recursive serialize() calls. FR #36424 2010-05-26 07:24:37 +00:00
Kalle Sommer Nielsen
dd8e59da8f Removed safe_mode
* Removed ini options, safe_mode*
 * Removed --enable-safe-mode --with-exec-dir configure options on Unix
 * Updated extensions, SAPI's and core
 * php_get_current_user() is now declared in main.c, thrus no need to include safe_mode.h anymore
2010-04-26 23:53:30 +00:00
Kalle Sommer Nielsen
9d395a4a2b Removed import_request_variables(), this is not needed anymore without register_globals 2010-04-21 22:23:55 +00:00
Kalle Sommer Nielsen
8087be61d0 * Changed the way removed ini directives are shown so its easier to add new ones
* Removed define_syslog_variables and its associated functions
2010-04-12 01:52:55 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Jani Taskinen
f395a2e34f - Fixed error_log() to be binary safe when using message_type 3 (message appended to file). 2009-11-22 18:31:01 +00:00
Jani Taskinen
ae492897c6 - Removed unused code (replaced long time ago by url_scanner_ex.* 2009-07-26 22:59:46 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Arnaud Le Blanc
2276e85f13 MFH: Added parse_ini_string() function (grange at lemonde dot fr, Arnaud)
[DOC] new function parse_ini_string()
      proto array parse_ini_string(string ini_string
          [, bool process_sections [, int scanner_mode]])
      Same as parse_ini_file() except that it takes a string instead of a
      filename.
2008-11-05 21:35:02 +00:00
Jani Taskinen
85ad3851e9 MFH 2008-04-15 08:44:21 +00:00
Hannes Magnusson
f0b7073308 [DOC] Remove config_get_hash() & and add new boolean parameter to ini_get_all()
to list ini entries key=>current_value like config_get_hash() did.
2008-04-14 15:32:42 +00:00
Etienne Kneuss
a1e0945143 MFH: Implement forward_static_call(_array) to complete LSB. Patch by Mike Lively 2008-04-07 10:44:59 +00:00
Marcus Boerger
f3d7570197 - MFH Rename it again
[DOC]
- MFH Add config_get_hash()
2008-02-03 14:45:00 +00:00
Marcus Boerger
fa94dabd97 - MFH Rename dump_config_hash() to get_config_hash() as it doesn't dump 2008-02-03 14:35:59 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Jani Taskinen
b489251177 - MFH from HEAD:
. Folding tags
  . Parameter parsing
  . SPL debug info
  . array function improvements (not all yet)
  . Improvements to function calling with call_user_* functions
  . Improvements to debugging info in var_dump/print_r
# I propably forgot already something but this all was pretty close tied
# to each other so it wasn't possible to do it in parts.
2007-11-02 19:40:39 +00:00
Jani Taskinen
2bc631fb40 MFH:- Added common getopt implementation to core.
MFH:- Added long-option feature to getopt().
MFH:- Made getopt() available on win32 systems.
MFH:  Patch by: David Soria Parra <dsp@php.net>
[DOC]: These changes will be available from 5.3+

# Note: Fixed also tests and synced basic_functions.c with HEAD.
2007-10-01 12:40:54 +00:00
Jani Taskinen
09b6f37f20 MFH:
- Added ".htaccess" style user-defined php.ini files support for
  CGI/FastCGI.
- Added support for special [PATH=/opt/httpd/www.example.com/] sections
  in php.ini. All directives set in these sections will not be able to be
  overridden in user-defined ini-files or during runtime in the specified
  path.

- Improved php.ini handling:
  . Added better error reporting for syntax errors in php.ini files
  . Allowed "ini-variables" to be used almost everywhere ini php.ini files
  . Allowed using alphanumeric/variable indexes in "array" ini options
  . Fixed get_cfg_var() to be able to return "array" ini options

- Fixed bug #27372 (parse error loading browscap.ini at apache startup)
- Fixed bug #42069 (parse_ini_file() allows using some non-alpha numeric
  characters)
2007-09-28 02:05:10 +00:00
Jani Taskinen
a22a6711ad MFH: Fixed compile warnings 2007-07-21 01:24:26 +00:00
Hannes Magnusson
c0dd1f4d0b MFH 2007-05-28 12:19:41 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Derick Rethans
de50222d1c - MFH: No idea if we actually support 16 bit systems, but this just looked wrong 2006-11-14 14:42:42 +00:00
Michael Wallner
46f21b8a32 MFH: added error_get_last() function 2006-07-19 12:25:46 +00:00
Ilia Alshanetsky
4ab6eb3d19 MFH: Fixed bug #36630 (umask not reset at the end of the request). 2006-05-14 16:06:48 +00:00
Rasmus Lerdorf
bab48a0906 Rename getloadavg to sys_getloadavg 2006-02-18 05:41:59 +00:00
Wez Furlong
a8be85ce7e add getloadavg() function that has been running in production on rs1.php.net
for a couple of years.
2006-02-16 22:49:13 +00:00
Frank M. Kromann
80cc4867e3 Export symbols that will allow building WDDX as shared object 2006-01-28 06:18:01 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Andrei Zmievski
ec09711101 Fix FCI cache for array_walk and user array compare functions. Bug
#33286. (Patch from m.bretz@metropolis-ag.de)
2005-06-15 20:51:33 +00:00
Ilia Alshanetsky
6f539ae99e Added time_sleep_until() function, which is a high precision mechanism of
making a script sleep until specified timestamp.
2005-04-10 16:25:11 +00:00
Ilia Alshanetsky
1d60050312 Removed php_check_syntax() function, it never worked properly. For now
use shell_exec("php -l script_name") or similar.
2005-04-06 14:19:14 +00:00
Sara Golemon
37b8c079d6 Fix inet_pton/ntop() on BSD 2004-08-07 15:59:59 +00:00
Sara Golemon
75f4ec8879 New Functions inet_pton() and inet_ntop() 2004-08-07 04:50:24 +00:00
Marcus Boerger
bc0373b880 Portable solution for bug #27646 that works correct on Windows, too 2004-03-27 00:50:41 +00:00
Wez Furlong
2b95eccf7e Ooops, these should not be pointers ;) 2004-02-23 21:03:58 +00:00