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 ...@@ -198,13 +198,18 @@ Apache 1.3.x on Unix systems
13. Setup your php.ini file: 13. Setup your php.ini file:
cp php.ini-dist /usr/local/lib/php.ini PHP will use the built-in default values if no php.ini file was
placed in the configuration directory. The default location is
You may edit your .ini file to set PHP options. If you prefer your /usr/local/lib, if you prefer your php.ini in another location, use
php.ini in another location, use --with-config-file-path=/some/path in --with-config-file-path=/some/path in step 10.
step 10.
The PHP distribution provides two sample php.ini files, you can use them
If you instead choose php.ini-recommended, be certain to read the list 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. 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 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 @@ ...@@ -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/types.h>
#include <sys/stat.h> #include <sys/stat.h>
...@@ -646,7 +646,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i ...@@ -646,7 +646,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
memcpy(path, bucket->realpath, bucket->realpath_len + 1); memcpy(path, bucket->realpath, bucket->realpath_len + 1);
return bucket->realpath_len; return bucket->realpath_len;
} }
} }
} }
#ifdef TSRM_WIN32 #ifdef TSRM_WIN32
...@@ -1099,7 +1099,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* { ...@@ -1099,7 +1099,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {
new_state.cwd[0] = '\0'; new_state.cwd[0] = '\0';
new_state.cwd_length = 0; new_state.cwd_length = 0;
} }
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) { if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) {
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
......
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 @@ ...@@ -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 #ifndef ZEND_ALLOC_H
#define ZEND_ALLOC_H #define ZEND_ALLOC_H
...@@ -89,7 +89,7 @@ inline static void * __zend_malloc(size_t len) ...@@ -89,7 +89,7 @@ inline static void * __zend_malloc(size_t len)
inline static void * __zend_calloc(size_t nmemb, size_t len) inline static void * __zend_calloc(size_t nmemb, size_t len)
{ {
void *tmp = _safe_malloc(nmemb, len, 0); void *tmp = _safe_malloc(nmemb, len, 0);
memset(tmp, 0, len); memset(tmp, 0, nmemb * len);
return tmp; return tmp;
} }
......
...@@ -17,7 +17,7 @@ ...@@ -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 #ifndef ZEND_EXTENSIONS_H
#define ZEND_EXTENSIONS_H #define ZEND_EXTENSIONS_H
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* The first number is the engine version and the rest is the date. /* 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.. * 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 { typedef struct _zend_extension_version_info {
int zend_extension_api_no; int zend_extension_api_no;
......
...@@ -17,7 +17,7 @@ ...@@ -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 #ifndef MODULES_H
#define MODULES_H #define MODULES_H
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC #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_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
#define ZEND_MODULE_API_NO 20090115 #define ZEND_MODULE_API_NO 20090626
#ifdef ZTS #ifdef ZTS
#define USING_ZTS 1 #define USING_ZTS 1
#else #else
......
...@@ -17,7 +17,7 @@ ...@@ -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.h"
#include "zend_globals.h" #include "zend_globals.h"
...@@ -942,8 +942,10 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f ...@@ -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) { if (function_name_strlen == ce->name_length && ce->constructor) {
lc_class_name = zend_str_tolower_dup(ce->name, ce->name_length); 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 */ /* Only change the method to the constructor if the constructor isn't called __construct
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))) { * 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; fbc = ce->constructor;
} }
efree(lc_class_name); 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. dnl ## Process this file with autoconf to produce a configure script.
divert(1) divert(1)
...@@ -42,7 +42,7 @@ AC_CONFIG_HEADER(main/php_config.h) ...@@ -42,7 +42,7 @@ AC_CONFIG_HEADER(main/php_config.h)
PHP_MAJOR_VERSION=5 PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=3 PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=0 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="$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` PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
...@@ -217,8 +217,11 @@ case $host_cpu in ...@@ -217,8 +217,11 @@ case $host_cpu in
;; ;;
sparc*) sparc*)
if test "$SUNCC" = "yes"; then if test "$SUNCC" = "yes"; then
CFLAGS="$CFLAGS -xmemalign=8s" CFLAGS="$CFLAGS -xmemalign=8i"
else
CFLAGS=""
fi fi
;;
esac esac
dnl activate some gcc specific optimizations for gcc >= 4 dnl activate some gcc specific optimizations for gcc >= 4
......
...@@ -16,7 +16,7 @@ ...@@ -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 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
...@@ -2052,6 +2052,14 @@ PHP_FUNCTION(curl_exec) ...@@ -2052,6 +2052,14 @@ PHP_FUNCTION(curl_exec)
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1); 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) { if (ch->handlers->write->method == PHP_CURL_RETURN) {
RETURN_EMPTY_STRING(); RETURN_EMPTY_STRING();
} else { } else {
......
...@@ -16,7 +16,7 @@ ...@@ -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.h"
#include "php_streams.h" #include "php_streams.h"
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
static __inline __int64_t llabs( __int64_t i ) { return i >= 0 ? i : -i; } static __inline __int64_t llabs( __int64_t i ) { return i >= 0 ? i : -i; }
#endif #endif
#if defined(NETWARE) && defined(__MWERKS__)
static __inline long long llabs( long long i ) { return i >= 0 ? i : -i; }
#endif
/* {{{ arginfo */ /* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1) ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1)
ZEND_ARG_INFO(0, format) ZEND_ARG_INFO(0, format)
...@@ -331,6 +335,7 @@ ZEND_END_ARG_INFO() ...@@ -331,6 +335,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_identifiers_list, 0, 0, 0) ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_identifiers_list, 0, 0, 0)
ZEND_ARG_INFO(0, what) ZEND_ARG_INFO(0, what)
ZEND_ARG_INFO(0, country)
ZEND_END_ARG_INFO() ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_timezone_abbreviations_list, 0) 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 ...@@ -1050,7 +1055,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
/* year */ /* year */
case 'L': length = slprintf(buffer, 32, "%d", timelib_is_leap((int) t->y)); break; 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, "%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 */ /* time */
case 'a': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break; 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) ...@@ -2208,6 +2213,10 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
props = intervalobj->std.properties; props = intervalobj->std.properties;
if (!intervalobj->initialized) {
return props;
}
#define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \ #define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \
MAKE_STD_ZVAL(zv); \ MAKE_STD_ZVAL(zv); \
ZVAL_LONG(zv, intervalobj->diff->f); \ ZVAL_LONG(zv, intervalobj->diff->f); \
...@@ -3737,7 +3746,7 @@ static int check_id_allowed(char *id, long what) ...@@ -3737,7 +3746,7 @@ static int check_id_allowed(char *id, long what)
return 0; 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. Returns numerically index array with all timezone identifiers.
*/ */
PHP_FUNCTION(timezone_identifiers_list) 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 ...@@ -5,6 +5,9 @@ Test gmstrftime() function : usage variation - Checking Preferred date and time
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
die("skip Test is not valid for Windows"); 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-- --FILE--
<?php <?php
......
...@@ -5,6 +5,9 @@ Test strftime() function : usage variation - Checking Preferred date and time re ...@@ -5,6 +5,9 @@ Test strftime() function : usage variation - Checking Preferred date and time re
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
die("skip Test is not valid for Windows"); 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-- --FILE--
<?php <?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 @@ ...@@ -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, /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */ Cold Spring Harbor Labs. */
...@@ -2010,7 +2010,6 @@ PHP_FUNCTION(imagegrabwindow) ...@@ -2010,7 +2010,6 @@ PHP_FUNCTION(imagegrabwindow)
pPrintWindow(window, memDC, (UINT) client_area); pPrintWindow(window, memDC, (UINT) client_area);
} else { } else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows API too old"); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows API too old");
RETURN_FALSE;
goto clean; 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 ...@@ -784,6 +784,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
double cos_a = cos (angle); double cos_a = cos (angle);
int len, i = 0, ch; int len, i = 0, ch;
int x1 = 0, y1 = 0; int x1 = 0, y1 = 0;
int xb = x, yb = y;
font_t *font; font_t *font;
fontkey_t fontkey; fontkey_t fontkey;
char *next; char *next;
...@@ -924,8 +925,8 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi ...@@ -924,8 +925,8 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
/* carriage returns */ /* carriage returns */
if (ch == '\r') { if (ch == '\r') {
penf.x = 0; penf.x = 0;
x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64; x1 = (int)(- penf.y * sin_a + 32) / 64;
y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64; y1 = (int)(- penf.y * cos_a + 32) / 64;
pen.x = pen.y = 0; pen.x = pen.y = 0;
previous = 0; /* clear kerning flag */ previous = 0; /* clear kerning flag */
next++; next++;
...@@ -937,8 +938,10 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi ...@@ -937,8 +938,10 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
penf.x = 0; penf.x = 0;
penf.y -= (long)(face->size->metrics.height * linespace); penf.y -= (long)(face->size->metrics.height * linespace);
penf.y = (penf.y - 32) & -64; /* round to next pixel row */ penf.y = (penf.y - 32) & -64; /* round to next pixel row */
x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64; x1 = (int)(- penf.y * sin_a + 32) / 64;
y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64; y1 = (int)(- penf.y * cos_a + 32) / 64;
xb = x + x1;
yb = y + y1;
pen.x = pen.y = 0; pen.x = pen.y = 0;
previous = 0; /* clear kerning flag */ previous = 0; /* clear kerning flag */
next++; next++;
...@@ -1088,7 +1091,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi ...@@ -1088,7 +1091,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
/* now, draw to our target surface */ /* now, draw to our target surface */
bm = (FT_BitmapGlyph) image; 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 */ /* record current glyph index for kerning */
...@@ -1127,14 +1130,14 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi ...@@ -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); brect[7] = (int) (normbox.xMin * sin_a + normbox.yMax * cos_a);
/* scale, round and offset brect */ /* scale, round and offset brect */
brect[0] = x + gdroundupdown(brect[0], d2 > 0); brect[0] = xb + gdroundupdown(brect[0], d2 > 0);
brect[1] = y - gdroundupdown(brect[1], d1 < 0); brect[1] = yb - gdroundupdown(brect[1], d1 < 0);
brect[2] = x + gdroundupdown(brect[2], d1 > 0); brect[2] = xb + gdroundupdown(brect[2], d1 > 0);
brect[3] = y - gdroundupdown(brect[3], d2 > 0); brect[3] = yb - gdroundupdown(brect[3], d2 > 0);
brect[4] = x + gdroundupdown(brect[4], d2 < 0); brect[4] = xb + gdroundupdown(brect[4], d2 < 0);
brect[5] = y - gdroundupdown(brect[5], d1 > 0); brect[5] = yb - gdroundupdown(brect[5], d1 > 0);
brect[6] = x + gdroundupdown(brect[6], d1 < 0); brect[6] = xb + gdroundupdown(brect[6], d1 < 0);
brect[7] = y - gdroundupdown(brect[7], d2 < 0); brect[7] = yb - gdroundupdown(brect[7], d2 < 0);
} }
if (tmpstr) { 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 @@ ...@@ -26,7 +26,7 @@
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> | | 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 #define IMAP41
...@@ -3019,7 +3019,7 @@ PHP_FUNCTION(imap_sort) ...@@ -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)); 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); mail_free_searchpgm(&spg);
} }
...@@ -3995,7 +3995,7 @@ PHP_FUNCTION(imap_search) ...@@ -3995,7 +3995,7 @@ PHP_FUNCTION(imap_search)
mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? charset : NIL), pgm, flags); 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); mail_free_searchpgm(&pgm);
} }
...@@ -4611,7 +4611,7 @@ PHP_FUNCTION(imap_thread) ...@@ -4611,7 +4611,7 @@ PHP_FUNCTION(imap_thread)
pgm = mail_criteria(criteria); pgm = mail_criteria(criteria);
top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL, pgm, flags); top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL, pgm, flags);
if (pgm) { if (pgm && !(flags & SE_FREE)) {
mail_free_searchpgm(&pgm); mail_free_searchpgm(&pgm);
} }