Commit d3a87578 authored by Sean Finney's avatar Sean Finney

Imported Upstream version 5.3.0

parent 84f4ca9b
......@@ -198,13 +198,18 @@ Apache 1.3.x on Unix systems
13. Setup your php.ini file:
cp php.ini-dist /usr/local/lib/php.ini
You may edit your .ini file to set PHP options. If you prefer your
php.ini in another location, use --with-config-file-path=/some/path in
step 10.
If you instead choose php.ini-recommended, be certain to read the list
PHP will use the built-in default values if no php.ini file was
placed in the configuration directory. The default location is
/usr/local/lib, if you prefer your php.ini in another location, use
--with-config-file-path=/some/path in step 10.
The PHP distribution provides two sample php.ini files, you can use them
by
cp php.ini-development /usr/local/lib/php.ini
or
cp php.ini-production /usr/local/lib/php.ini
If you choose one of these php.ini files be certain to read the list
of changes within, as they affect how PHP behaves.
14. Edit your httpd.conf to load the PHP module. The path on the right hand
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.35.2.21 2009/06/16 21:54:12 pajoye Exp $ */
/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.35.2.22 2009/06/26 07:39:42 pajoye Exp $ */
#include <sys/types.h>
#include <sys/stat.h>
......
This diff is collapsed.
--TEST--
Bug #48215 - parent::method() calls __construct, case sensitive test
--FILE--
<?php
class a {
public function __CONSTRUCT() { echo __METHOD__ . "\n"; }
public function a() { echo __METHOD__ . "\n"; }
}
class b extends a {}
class c extends b {
function C() {
b::b();
}
}
$c = new c();
?>
===DONE===
--EXPECTF--
Strict Standards: Redefining already defined constructor for class a in %s on line %d
Fatal error: Call to undefined method b::b() in %s on line %d
......@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: zend_alloc.h,v 1.63.2.2.2.12.2.9 2009/01/25 13:41:50 dsp Exp $ */
/* $Id: zend_alloc.h,v 1.63.2.2.2.12.2.10 2009/06/28 09:48:48 pajoye Exp $ */
#ifndef ZEND_ALLOC_H
#define ZEND_ALLOC_H
......@@ -89,7 +89,7 @@ inline static void * __zend_malloc(size_t len)
inline static void * __zend_calloc(size_t nmemb, size_t len)
{
void *tmp = _safe_malloc(nmemb, len, 0);
memset(tmp, 0, len);
memset(tmp, 0, nmemb * len);
return tmp;
}
......
......@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: zend_extensions.h,v 1.67.2.3.2.3.2.8 2009/04/08 23:06:16 stas Exp $ */
/* $Id: zend_extensions.h,v 1.67.2.3.2.3.2.9 2009/06/26 15:44:18 johannes Exp $ */
#ifndef ZEND_EXTENSIONS_H
#define ZEND_EXTENSIONS_H
......@@ -28,7 +28,7 @@
/* The first number is the engine version and the rest is the date.
* This way engine 2/3 API no. is always greater than engine 1 API no..
*/
#define ZEND_EXTENSION_API_NO 220090115
#define ZEND_EXTENSION_API_NO 220090626
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
......
......@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: zend_modules.h,v 1.67.2.3.2.4.2.8 2009/01/17 02:05:13 stas Exp $ */
/* $Id: zend_modules.h,v 1.67.2.3.2.4.2.9 2009/06/26 15:44:19 johannes Exp $ */
#ifndef MODULES_H
#define MODULES_H
......@@ -33,7 +33,7 @@
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
#define ZEND_MODULE_API_NO 20090115
#define ZEND_MODULE_API_NO 20090626
#ifdef ZTS
#define USING_ZTS 1
#else
......
......@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: zend_object_handlers.c,v 1.135.2.6.2.22.2.30 2009/06/18 13:46:16 scottmac Exp $ */
/* $Id: zend_object_handlers.c,v 1.135.2.6.2.22.2.31 2009/06/19 03:29:47 scottmac Exp $ */
#include "zend.h"
#include "zend_globals.h"
......@@ -942,8 +942,10 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
if (function_name_strlen == ce->name_length && ce->constructor) {
lc_class_name = zend_str_tolower_dup(ce->name, ce->name_length);
/* Only change the method to the constructor if a __construct() method doesn't exist */
if (!memcmp(lc_class_name, function_name_strval, function_name_strlen) && memcmp(ce->constructor->common.function_name, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
/* Only change the method to the constructor if the constructor isn't called __construct
* we check for __ so we can be binary safe for lowering, we should use ZEND_CONSTRUCTOR_FUNC_NAME
*/
if (!memcmp(lc_class_name, function_name_strval, function_name_strlen) && memcmp(ce->constructor->common.function_name, "__", sizeof("__") - 1)) {
fbc = ce->constructor;
}
efree(lc_class_name);
......
This diff is collapsed.
## $Id: configure.in,v 1.579.2.52.2.77.2.55 2009/06/18 21:01:03 johannes Exp $ -*- autoconf -*-
## $Id: configure.in,v 1.579.2.52.2.77.2.58 2009/06/26 15:44:18 johannes Exp $ -*- autoconf -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
......@@ -42,7 +42,7 @@ AC_CONFIG_HEADER(main/php_config.h)
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="RC4"
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
......@@ -217,8 +217,11 @@ case $host_cpu in
;;
sparc*)
if test "$SUNCC" = "yes"; then
CFLAGS="$CFLAGS -xmemalign=8s"
CFLAGS="$CFLAGS -xmemalign=8i"
else
CFLAGS=""
fi
;;
esac
dnl activate some gcc specific optimizations for gcc >= 4
......
......@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: interface.c,v 1.62.2.14.2.27.2.57 2009/06/15 12:37:37 iliaa Exp $ */
/* $Id: interface.c,v 1.62.2.14.2.27.2.58 2009/06/28 09:50:14 pajoye Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
......@@ -2052,6 +2052,14 @@ PHP_FUNCTION(curl_exec)
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
}
/* flush the file handle, so any remaining data is synched to disk */
if (ch->handlers->write->method == PHP_CURL_FILE && ch->handlers->write->fp) {
fflush(ch->handlers->write->fp);
}
if (ch->handlers->write_header->method == PHP_CURL_FILE && ch->handlers->write_header->fp) {
fflush(ch->handlers->write_header->fp);
}
if (ch->handlers->write->method == PHP_CURL_RETURN) {
RETURN_EMPTY_STRING();
} else {
......
......@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: php_date.c,v 1.43.2.45.2.51.2.79 2009/06/17 17:56:17 bjori Exp $ */
/* $Id: php_date.c,v 1.43.2.45.2.51.2.84 2009/06/25 15:07:36 johannes Exp $ */
#include "php.h"
#include "php_streams.h"
......@@ -39,6 +39,10 @@
static __inline __int64_t llabs( __int64_t i ) { return i >= 0 ? i : -i; }
#endif
#if defined(NETWARE) && defined(__MWERKS__)
static __inline long long llabs( long long i ) { return i >= 0 ? i : -i; }
#endif
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1)
ZEND_ARG_INFO(0, format)
......@@ -331,6 +335,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_identifiers_list, 0, 0, 0)
ZEND_ARG_INFO(0, what)
ZEND_ARG_INFO(0, country)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_timezone_abbreviations_list, 0)
......@@ -1050,7 +1055,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
/* year */
case 'L': length = slprintf(buffer, 32, "%d", timelib_is_leap((int) t->y)); break;
case 'y': length = slprintf(buffer, 32, "%02d", (int) t->y % 100); break;
case 'Y': length = slprintf(buffer, 32, "%s%04ld", t->y < 0 ? "-" : "", llabs((timelib_sll) t->y)); break;
case 'Y': length = slprintf(buffer, 32, "%s%04lld", t->y < 0 ? "-" : "", llabs((timelib_sll) t->y)); break;
/* time */
case 'a': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break;
......@@ -2208,6 +2213,10 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
props = intervalobj->std.properties;
if (!intervalobj->initialized) {
return props;
}
#define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \
MAKE_STD_ZVAL(zv); \
ZVAL_LONG(zv, intervalobj->diff->f); \
......@@ -3737,7 +3746,7 @@ static int check_id_allowed(char *id, long what)
return 0;
}
/* {{{ proto array timezone_identifiers_list([long what])
/* {{{ proto array timezone_identifiers_list([long what[, string country]])
Returns numerically index array with all timezone identifiers.
*/
PHP_FUNCTION(timezone_identifiers_list)
......
--TEST--
Bug #48276 (date("Y") prints wrong year on Big Endian machines)
--INI--
date.timezone=UTC
--FILE--
<?php
var_dump(date("Y", 1245623227));
--EXPECT--
string(4) "2009"
--TEST--
Bug #48678 DateInterval segfaults when unserialising
--FILE--
<?php
$x = new dateinterval("P3Y6M4DT12H30M5S");
print_r($x);
$y = unserialize(serialize($x));
print_r($y);
--EXPECT--
DateInterval Object
(
[y] => 3
[m] => 6
[d] => 4
[h] => 12
[i] => 30
[s] => 5
[invert] => 0
[days] => 0
)
DateInterval Object
(
[y] => 3
[m] => 6
[d] => 4
[h] => 12
[i] => 30
[s] => 5
[invert] => 0
[days] => 0
)
......@@ -5,6 +5,9 @@ Test gmstrftime() function : usage variation - Checking Preferred date and time
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
die("skip Test is not valid for Windows");
}
if (!setlocale(LC_ALL, "en_US.utf8", "en_US")) {
die("skip Locale en_US or en_US.utf8 is required to run this test");
}
?>
--FILE--
<?php
......
......@@ -5,6 +5,9 @@ Test strftime() function : usage variation - Checking Preferred date and time re
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
die("skip Test is not valid for Windows");
}
if(!setlocale(LC_ALL, "en_US.utf8", "en_US")) {
die("skip Locale en_US.utf8 or en_US is needed by test and is not available");
}
?>
--FILE--
<?php
......
Author: Christos Zoulas <christos@zoulas.com>
Download: ftp://ftp.astron.com/pub/file/
Files: *
Copyright:
(C) 1985-1995 Ian F. Darwin
(C) 1994-2009 Christos Zoulas <christos@zoulas.com>
License: BSD
This software is not subject to any export provision of the United States
Department of Commerce, and may be exported to any country or planet.
.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
.
1. Redistributions of source code must retain the above copyright
notice immediately at the beginning of the file, without modification,
this list of conditions, and the following disclaimer.
.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
......@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: gd.c,v 1.312.2.20.2.32.2.42 2009/05/27 08:18:23 pajoye Exp $ */
/* $Id: gd.c,v 1.312.2.20.2.32.2.43 2009/06/19 22:15:28 kalle Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
......@@ -2010,7 +2010,6 @@ PHP_FUNCTION(imagegrabwindow)
pPrintWindow(window, memDC, (UINT) client_area);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows API too old");
RETURN_FALSE;
goto clean;
}
......
Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002 by Cold Spring Harbor Laboratory. Funded under Grant
P41-RR02188 by the National Institutes of Health.
Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 by
Boutell.Com, Inc.
Portions relating to GD2 format copyright 1999, 2000, 2001, 2002
Philip Warner.
Portions relating to PNG copyright 1999, 2000, 2001, 2002 Greg
Roelofs.
Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002 John
Ellson (ellson@lucent.com).
Portions relating to gdft.c copyright 2001, 2002 John Ellson
(ellson@lucent.com).
Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
2008, 2009 Pierre-Alain Joye (pierre@libgd.org).
Portions relating to JPEG and to color quantization copyright 2000,
2001, 2002, Doug Becker and copyright (C) 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, Thomas G. Lane. This software is
based in part on the work of the Independent JPEG Group. See the
file README-JPEG.TXT for more information.
Portions relating to WBMP copyright 2000, 2001, 2002 Maurice
Szmurlo and Johan Van den Brande.
Permission has been granted to copy, distribute and modify gd in
any context without fee, including a commercial application,
provided that this notice is present in user-accessible supporting
documentation.
This does not affect your ownership of the derived work itself, and
the intent is to assure proper credit for the authors of gd, not to
interfere with your productive use of gd. If you have questions,
ask. "Derived works" includes all programs that utilize the
library. Credit must be given in user-accessible documentation.
This software is provided "AS IS." The copyright holders disclaim
all warranties, either express or implied, including but not
limited to implied warranties of merchantability and fitness for a
particular purpose, with respect to this code and accompanying
documentation.
Although their code does not appear in gd, the authors wish to thank
David Koblas, David Rowley, and Hutchison Avenue Software Corporation
for their prior contributions.
......@@ -784,6 +784,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
double cos_a = cos (angle);
int len, i = 0, ch;
int x1 = 0, y1 = 0;
int xb = x, yb = y;
font_t *font;
fontkey_t fontkey;
char *next;
......@@ -924,8 +925,8 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
/* carriage returns */
if (ch == '\r') {
penf.x = 0;
x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64;
y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64;
x1 = (int)(- penf.y * sin_a + 32) / 64;
y1 = (int)(- penf.y * cos_a + 32) / 64;
pen.x = pen.y = 0;
previous = 0; /* clear kerning flag */
next++;
......@@ -937,8 +938,10 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
penf.x = 0;
penf.y -= (long)(face->size->metrics.height * linespace);
penf.y = (penf.y - 32) & -64; /* round to next pixel row */
x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64;
y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64;
x1 = (int)(- penf.y * sin_a + 32) / 64;
y1 = (int)(- penf.y * cos_a + 32) / 64;
xb = x + x1;
yb = y + y1;
pen.x = pen.y = 0;
previous = 0; /* clear kerning flag */
next++;
......@@ -1088,7 +1091,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
/* now, draw to our target surface */
bm = (FT_BitmapGlyph) image;
gdft_draw_bitmap(tc_cache, im, fg, bm->bitmap, x + x1 + ((pen.x + 31) >> 6) + bm->left, y - y1 + ((pen.y + 31) >> 6) - bm->top);
gdft_draw_bitmap(tc_cache, im, fg, bm->bitmap, x + x1 + ((pen.x + 31) >> 6) + bm->left, y + y1 + ((pen.y + 31) >> 6) - bm->top);
}
/* record current glyph index for kerning */
......@@ -1127,14 +1130,14 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
brect[7] = (int) (normbox.xMin * sin_a + normbox.yMax * cos_a);
/* scale, round and offset brect */
brect[0] = x + gdroundupdown(brect[0], d2 > 0);
brect[1] = y - gdroundupdown(brect[1], d1 < 0);
brect[2] = x + gdroundupdown(brect[2], d1 > 0);
brect[3] = y - gdroundupdown(brect[3], d2 > 0);
brect[4] = x + gdroundupdown(brect[4], d2 < 0);
brect[5] = y - gdroundupdown(brect[5], d1 > 0);
brect[6] = x + gdroundupdown(brect[6], d1 < 0);
brect[7] = y - gdroundupdown(brect[7], d2 < 0);
brect[0] = xb + gdroundupdown(brect[0], d2 > 0);
brect[1] = yb - gdroundupdown(brect[1], d1 < 0);
brect[2] = xb + gdroundupdown(brect[2], d1 > 0);
brect[3] = yb - gdroundupdown(brect[3], d2 > 0);
brect[4] = xb + gdroundupdown(brect[4], d2 < 0);
brect[5] = yb - gdroundupdown(brect[5], d1 > 0);
brect[6] = xb + gdroundupdown(brect[6], d1 < 0);
brect[7] = yb - gdroundupdown(brect[7], d2 < 0);
}
if (tmpstr) {
......
--TEST--
Bug #48555 (ImageFTBBox() differs from previous versions for texts with new lines)
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
?>
--FILE--
<?php
$cwd = dirname(__FILE__);
$font = "$cwd/Tuffy.ttf";
$box = ImageFTBBox(13, 0, $font, "Text without line-break");
echo 'Top without line-break: ' . $box[7] . "\n";
$box = ImageFTBBox(13, 0, $font, "Text with\nline-break\none more");
echo 'Top with line-break: ' . $box[7] . "\n";
?>
--EXPECTF--
Top without line-break: -15
Top with line-break: -15
......@@ -26,7 +26,7 @@
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id: php_imap.c,v 1.208.2.7.2.26.2.49 2009/06/06 02:40:48 mattwil Exp $ */
/* $Id: php_imap.c,v 1.208.2.7.2.26.2.50 2009/06/22 14:09:55 pajoye Exp $ */
#define IMAP41
......@@ -3019,7 +3019,7 @@ PHP_FUNCTION(imap_sort)
slst = mail_sort(imap_le_struct->imap_stream, (argc == 6 ? charset : NIL), spg, mypgm, (argc >= 4 ? flags : NIL));
if (spg) {
if (spg && !(flags & SE_FREE)) {
mail_free_searchpgm(&spg);
}
......@@ -3995,7 +3995,7 @@ PHP_FUNCTION(imap_search)
mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? charset : NIL), pgm, flags);
if (pgm) {
if (pgm && !(flags & SE_FREE)) {
mail_free_searchpgm(&pgm);
}
......@@ -4611,7 +4611,7 @@ PHP_FUNCTION(imap_thread)
pgm = mail_criteria(criteria);
top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL, pgm, flags);
if (pgm) {
if (pgm && !(flags & SE_FREE)) {
mail_free_searchpgm(&pgm);
}
......
dnl
dnl $Id: config.m4,v 1.3.2.4 2007/07/03 17:25:33 sniper Exp $
dnl $Id: config.m4,v 1.3.2.4.2.1 2009/06/23 13:09:34 johannes Exp $
dnl
PHP_ARG_ENABLE(json, whether to enable JavaScript Object Serialization support,
......@@ -10,5 +10,6 @@ if test "$PHP_JSON" != "no"; then
AC_HEADER_STDC
PHP_NEW_EXTENSION(json, json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c, $ext_shared)
PHP_INSTALL_HEADERS([ext/json], [php_json.h])
PHP_SUBST(JSON_SHARED_LIBADD)
fi
......@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: json.c,v 1.9.2.19.2.23 2009/05/31 13:51:08 jani Exp $ */
/* $Id: json.c,v 1.9.2.19.2.24 2009/06/24 17:39:52 felipe Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
......@@ -486,6 +486,7 @@ PHPAPI void php_json_decode(zval *return_value, char *str, int str_len, zend_boo
if (depth <= 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must greater than zero");
efree(utf16);
RETURN_NULL();
}
......
......@@ -23,7 +23,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: ldap.c,v 1.161.2.3.2.11.2.29 2009/06/15 15:18:31 patrickallaert Exp $ */
/* $Id: ldap.c,v 1.161.2.3.2.11.2.30 2009/06/25 15:19:29 johannes Exp $ */
#define IS_EXT_MODULE
#ifdef HAVE_CONFIG_H
......@@ -224,7 +224,7 @@ PHP_MINFO_FUNCTION(ldap)
php_info_print_table_start();
php_info_print_table_row(2, "LDAP Support", "enabled");
php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.161.2.3.2.11.2.29 2009/06/15 15:18:31 patrickallaert Exp $");
php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.161.2.3.2.11.2.30 2009/06/25 15:19:29 johannes Exp $");
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
......@@ -589,7 +589,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
char *ldap_base_dn = NULL;
char *ldap_filter = NULL;
char **ldap_attrs = NULL;
ldap_linkdata *ld;
ldap_linkdata *ld = NULL;
LDAPMessage *ldap_res;
int ldap_attrsonly = 0;
int ldap_sizelimit = -1;
......@@ -806,8 +806,10 @@ cleanup_parallel:
}
cleanup:
// Restoring previous options
if (ld) {
/* Restoring previous options */
php_set_opts(ld->link, old_ldap_sizelimit, old_ldap_timelimit, old_ldap_deref, &ldap_sizelimit, &ldap_timelimit, &ldap_deref);
}
if (ldap_attrs != NULL) {
efree(ldap_attrs);
}
......
--TEST--
Bug #48696 (ldap_read() segfaults with invalid parameters)
--FILE--
<?php
ldap_read(1,1,1);
?>
--EXPECTF--
Warning: ldap_read(): supplied argument is not a valid ldap link resource in %s on line %d
......@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: libxml.c,v 1.32.2.7.2.15.2.11 2009/03/14 17:30:28 rrichards Exp $ */
/* $Id: libxml.c,v 1.32.2.7.2.15.2.13 2009/06/23 13:44:24 bjori Exp $ */
#define IS_EXT_MODULE
......@@ -68,6 +68,7 @@ static PHP_FUNCTION(libxml_use_internal_errors);
static PHP_FUNCTION(libxml_get_last_error);
static PHP_FUNCTION(libxml_clear_errors);
static PHP_FUNCTION(libxml_get_errors);
static PHP_FUNCTION(libxml_disable_entity_loader);
static zend_class_entry *libxmlerror_class_entry;
......@@ -91,7 +92,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_libxml_set_streams_context, 0)
ZEND_ARG_INFO(0, context)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_libxml_use_internal_errors, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_libxml_use_internal_errors, 0, 0, 0)
ZEND_ARG_INFO(0, use_errors)
ZEND_END_ARG_INFO()
......@@ -104,6 +105,10 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_libxml_clear_errors, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_libxml_disable_entity_loader, 0, 0, 0)
ZEND_ARG_INFO(0, disable)
ZEND_END_ARG_INFO()
/* }}} */
/* {{{ extension definition structures */
......@@ -113,6 +118,7 @@ static const zend_function_entry libxml_functions[] = {
PHP_FE(libxml_get_last_error, arginfo_libxml_get_last_error)
PHP_FE(libxml_clear_errors, arginfo_libxml_clear_errors)
PHP_FE(libxml_get_errors, arginfo_libxml_get_errors)
PHP_FE(libxml_disable_entity_loader, arginfo_libxml_disable_entity_loader)
{NULL, NULL, NULL}
};
......@@ -343,6 +349,12 @@ static int php_libxml_streams_IO_close(void *context)
return php_stream_close((php_stream*)context);
}
static xmlParserInputBufferPtr
php_libxml_input_buffer_noload(const char *URI, xmlCharEncoding enc)
{
return NULL;
}
static xmlParserInputBufferPtr
php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
{
......@@ -820,6 +832,31 @@ static PHP_FUNCTION(libxml_clear_errors)
}
/* }}} */
/* {{{ proto bool libxml_disable_entity_loader([boolean disable])
Disable/Enable ability to load external entities */
static PHP_FUNCTION(libxml_disable_entity_loader)
{
zend_bool disable = 1;
xmlParserInputBufferCreateFilenameFunc old;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &disable) == FAILURE) {
return;
}
if (disable == 0) {
old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_create_filename);
} else {
old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_noload);
}
if (old == php_libxml_input_buffer_noload) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ Common functions shared by extensions */
int php_libxml_xmlCheckUTF8(const unsigned char *s)
{
......
dnl
dnl $Id: config9.m4,v 1.3.2.9 2009/03/17 10:05:19 johannes Exp $
dnl $Id: config9.m4,v 1.3.2.10 2009/06/23 13:19:28 johannes Exp $
dnl config.m4 for mysqlnd driver
PHP_ARG_ENABLE(mysqlnd_threading, whether to enable threaded fetch in mysqlnd,
[ --enable-mysqlnd-threading
MYSQLND: Enable threaded fetch. Note: This forces ZTS on!], no, no)
EXPERIMENTAL: Enable mysqlnd threaded fetch.
Note: This forces ZTS on!], no, no)
dnl If some extension uses mysqlnd it will get compiled in PHP core
if test "$PHP_MYSQLND_ENABLED" = "yes"; then
......@@ -23,7 +24,7 @@ if test "$PHP_MYSQLND_ENABLED" = "yes"; then