Merge branch 'master' into rc_debug

* master: (26 commits)
  Better fix for bug #75451 (Assertion fails while foreach on empty xpath query)
  Catch with the latest AppVeyor unzip errors
  Fixed type inference
  Fix bug #75453 Incorrect reflection on ibase_connect and ibase_pconnect
  Fix compiler warnings
  We don't use a specific model for a MAKERNOTE so remove these checks that doesn't do anything anyway
  Remove these old comments, as for the TODO, there is already a FR for this
  Re-enable AppVeyor cache
  make sure run-tests reports exit status upon prerequisite error
  Remove implicit constants from test case
  Fix invalid read in zend_use_undefined_constant()
  Fix invalid read in mb_ord()
  Remove --with-libmbfl configure option
  Fixed bug #75451 (Assertion fails while foreach on empty xpath query)
  Add tests for UConverter::getStandards()
  convert spaces to tabs in ext/ftp/tests/server.inc
  Add tests for ftp_rename
  Fix bug #75434 Wrong reflection for mysqli_fetch_all function
  Don't optimize input arrays with suffix holes
  Fix bug #75307 Wrong reflection for openssl_open function
  ...
This commit is contained in:
Dmitry Stogov 2017-10-30 12:11:35 +03:00
commit fad75a54d4
29 changed files with 420 additions and 290 deletions

View File

@ -16,9 +16,9 @@ skip_commits:
clone_depth: 64
#cache:
# - c:\build-cache
# - c:\build-cache\sdk -> .appveyor.yml
cache:
- c:\build-cache
- c:\build-cache\sdk -> .appveyor.yml
environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache

8
NEWS
View File

@ -44,6 +44,9 @@ PHP NEWS
. Fixed bug #75317 (UConverter::setDestinationEncoding changes source instead
of destination). (andrewnester)
- interbase:
. Fixed bug #75453 (Incorrect reflection for ibase_[p]connect). (villfa)
- JSON:
. Added JSON_THROW_ON_ERROR flag. (Andrea)
@ -70,6 +73,9 @@ PHP NEWS
. Removed support for ODBCRouter. (Kalle)
. Removed support for Birdstep. (Kalle)
- OpenSSL:
. Fixed bug #75307 (Wrong reflection for openssl_open function). (villfa)
- PDO_DBlib:
. Implemented request #69592 (allow 0-column rowsets to be skipped
automatically). (fandrieu)
@ -109,6 +115,8 @@ PHP NEWS
- Standard:
. Fixed unzserialize(), to disable creation of unsupported data structures
through manually crafted strings. (Dmitry)
. Short circuit case where array_slice() would return its original array.
(Sara, Benjamin Coutu)
- Zlib:
. Added zlib/level context option for compress.zlib wrapper. (Sara)

View File

@ -568,8 +568,9 @@ ZEND_API int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr,
if (EG(exception)) {
return FAILURE;
} else {
zend_string *result_str = zend_string_init(actual, actual_len, 0);
zval_ptr_dtor_nogc(result);
ZVAL_STRINGL(result, actual, actual_len);
ZVAL_NEW_STR(result, result_str);
}
}
return SUCCESS;

View File

@ -17,10 +17,17 @@ if not exist "%PHP_BUILD_CACHE_SDK_DIR%" (
echo Cloning remote SDK repository
git clone --branch %SDK_BRANCH% %SDK_REMOTE% "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1
) else (
echo Fetching remote SDK repository
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin 2>&1
echo Checkout SDK repository branch
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH%
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" status 2>&1
if %errorlevel% neq 0 (
rmdir /s /q "%PHP_BUILD_CACHE_SDK_DIR%"
echo Cloning remote SDK repository
git clone --branch %SDK_BRANCH% %SDK_REMOTE% "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1
) else (
echo Fetching remote SDK repository
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin 2>&1
echo Checkout SDK repository branch
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH%
)
)
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat

View File

@ -197,8 +197,8 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter) /* {{{ */
objmap->nodetype != XML_NOTATION_NODE) {
if (objmap->nodetype == DOM_NODESET) {
nodeht = HASH_OF(&objmap->baseobj_zv);
zend_hash_move_forward(nodeht);
if ((entry = zend_hash_get_current_data(nodeht))) {
zend_hash_move_forward_ex(nodeht, &iterator->pos);
if ((entry = zend_hash_get_current_data_ex(nodeht, &iterator->pos))) {
zval_ptr_dtor(&iterator->curobj);
ZVAL_UNDEF(&iterator->curobj);
ZVAL_COPY(&iterator->curobj, entry);
@ -281,8 +281,8 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, i
objmap->nodetype != XML_NOTATION_NODE) {
if (objmap->nodetype == DOM_NODESET) {
nodeht = HASH_OF(&objmap->baseobj_zv);
zend_hash_internal_pointer_reset(nodeht);
if ((entry = zend_hash_get_current_data(nodeht))) {
zend_hash_internal_pointer_reset_ex(nodeht, &iterator->pos);
if ((entry = zend_hash_get_current_data_ex(nodeht, &iterator->pos))) {
ZVAL_COPY(&iterator->curobj, entry);
}
} else {

View File

@ -93,6 +93,7 @@ typedef struct _dom_nnodemap_object {
typedef struct {
zend_object_iterator intern;
zval curobj;
HashPosition pos;
} php_dom_iterator;
#include "dom_fe.h"

View File

@ -0,0 +1,18 @@
--TEST--
Bug #75451 (Assertion fails while foreach on empty xpath query)
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
$dom = new DOMDocument();
$dom->loadXML('<root><child/></root>');
$xpath = new DOMXpath($dom);
foreach($xpath->query('/root/noexist') as $child) {
var_dump($child);
}
?>
okey
--EXPECT--
okey

View File

@ -1,4 +1,4 @@
/*
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
@ -19,20 +19,6 @@
/* $Id$ */
/* ToDos
*
* See if example images from http://www.exif.org have illegal
* thumbnail sizes or if code is corrupt.
* Create/Update exif headers.
* Create/Remove/Update image thumbnails.
*/
/* Security
*
* At current time i do not see any security problems but a potential
* attacker could generate an image with recursive ifd pointers...(Marcus)
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -1349,7 +1335,6 @@ typedef enum mn_offset_mode_t {
typedef struct {
tag_table_type tag_table;
char * make;
char * model;
char * id_string;
int id_string_len;
int offset;
@ -1359,27 +1344,27 @@ typedef struct {
/* Remember to update PHP_MINFO if updated */
static const maker_note_type maker_note_array[] = {
{ tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_NORMAL},
{ tag_table_VND_CASIO, "CASIO", NULL, NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
{ tag_table_VND_FUJI, "FUJIFILM", NULL, "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER},
{ tag_table_VND_NIKON, "NIKON", NULL, "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_NIKON_990, "NIKON", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_OLYMPUS, "OLYMPUS OPTICAL CO.,LTD", NULL, "OLYMP\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_SAMSUNG, "SAMSUNG", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_PANASONIC, "Panasonic", NULL, "Panasonic\x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_DJI, "DJI", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_SONY, "SONY", NULL, "SONY DSC \x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_PENTAX, "PENTAX", NULL, "AOC\x00", 6, 6, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_MINOLTA, "Minolta, KONICA MINOLTA", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", NULL, "SIGMA\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", NULL, "FOVEON\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_KYOCERA, "KYOCERA, CONTAX", NULL, "KYOCERA \x00\x00\x00", 22, 22, MN_ORDER_NORMAL, MN_OFFSET_MAKER},
{ tag_table_VND_RICOH, "RICOH", NULL, "Ricoh", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
{ tag_table_VND_RICOH, "RICOH", NULL, "RICOH", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
{ tag_table_VND_CANON, "Canon", NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_NORMAL},
{ tag_table_VND_CASIO, "CASIO", NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
{ tag_table_VND_FUJI, "FUJIFILM", "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER},
{ tag_table_VND_NIKON, "NIKON", "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_NIKON_990, "NIKON", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_OLYMPUS, "OLYMPUS OPTICAL CO.,LTD", "OLYMP\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_SAMSUNG, "SAMSUNG", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_PANASONIC, "Panasonic", "Panasonic\x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_DJI, "DJI", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_SONY, "SONY", "SONY DSC \x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_PENTAX, "PENTAX", "AOC\x00", 6, 6, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_MINOLTA, "Minolta, KONICA MINOLTA", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", "SIGMA\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", "FOVEON\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_KYOCERA, "KYOCERA, CONTAX", "KYOCERA \x00\x00\x00", 22, 22, MN_ORDER_NORMAL, MN_OFFSET_MAKER},
{ tag_table_VND_RICOH, "RICOH", "Ricoh", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
{ tag_table_VND_RICOH, "RICOH", "RICOH", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
/* These re-uses existing formats */
{ tag_table_VND_OLYMPUS, "AGFA", NULL, "AGFA \x00\x01", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_OLYMPUS, "EPSON", NULL, "EPSON\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}
{ tag_table_VND_OLYMPUS, "AGFA", "AGFA \x00\x01", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_OLYMPUS, "EPSON", "EPSON\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}
};
/* }}} */
@ -1529,12 +1514,12 @@ static void php_ifd_set32u(char *data, size_t value, int motorola_intel)
{
if (motorola_intel) {
data[0] = (value & 0xFF000000) >> 24;
data[1] = (value & 0x00FF0000) >> 16;
data[1] = (char) ((value & 0x00FF0000) >> 16);
data[2] = (value & 0x0000FF00) >> 8;
data[3] = (value & 0x000000FF);
} else {
data[3] = (value & 0xFF000000) >> 24;
data[2] = (value & 0x00FF0000) >> 16;
data[2] = (char) ((value & 0x00FF0000) >> 16);
data[1] = (value & 0x0000FF00) >> 8;
data[0] = (value & 0x000000FF);
}
@ -3138,11 +3123,9 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
maker_note = maker_note_array+i;
/*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s,%s)", maker_note->make?maker_note->make:"", maker_note->model?maker_note->model:"");*/
/*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s)", maker_note->make?maker_note->make:"");*/
if (maker_note->make && (!ImageInfo->make || strcmp(maker_note->make, ImageInfo->make)))
continue;
if (maker_note->model && (!ImageInfo->model || strcmp(maker_note->model, ImageInfo->model)))
continue;
if (maker_note->id_string && strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len))
continue;
break;

View File

@ -54,11 +54,11 @@ foreach ($values as $value) {
}
var_dump(filter_var("qwe", FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED));
var_dump(filter_var("http://qwe", FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED));
var_dump(filter_var("http://", FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED));
var_dump(filter_var("/tmp/test", FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED));
var_dump(filter_var("http://www.example.com", FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED));
var_dump(filter_var("qwe", FILTER_VALIDATE_URL));
var_dump(filter_var("http://qwe", FILTER_VALIDATE_URL));
var_dump(filter_var("http://", FILTER_VALIDATE_URL));
var_dump(filter_var("/tmp/test", FILTER_VALIDATE_URL));
var_dump(filter_var("http://www.example.com", FILTER_VALIDATE_URL));
var_dump(filter_var("http://www.example.com", FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED));
var_dump(filter_var("http://www.example.com/path/at/the/server/", FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED));
var_dump(filter_var("http://www.example.com/index.html", FILTER_VALIDATE_URL, FILTER_FLAG_QUERY_REQUIRED));

View File

@ -0,0 +1,23 @@
--TEST--
FTP basic ftp_rename calls
--SKIPIF--
<?php
require 'skipif.inc';
?>
--FILE--
<?php
require 'server.inc';
$ftp = ftp_connect('127.0.0.1', $port);
if (!$ftp) die("Couldn't connect to the server");
ftp_login($ftp, 'user', 'pass');
var_dump(ftp_rename($ftp, 'existing_file', 'nonexisting_file'));
var_dump(ftp_rename($ftp, 'nonexisting_file', 'nonexisting_file'));
?>
--EXPECTF--
bool(true)
Warning: ftp_rename(): No such file or directory in %sftp_rename_basic1.php on line 10
bool(false)

View File

@ -286,7 +286,7 @@ if ($pid) {
file_put_contents(__DIR__.'/'.$m[1], $data, FILE_APPEND);
fputs($s, "226 Closing data Connection.\r\n");
fclose($fs);
}
}
}elseif (preg_match("~^CWD ([A-Za-z./]+)\r\n$~", $buf, $m)) {
change_dir($m[1]);
@ -395,17 +395,17 @@ if ($pid) {
$transfer_type = $ascii? 'ASCII' : 'BINARY' ;
fputs($fs, "Bar\r\n");
fputs($s, "226 Closing data Connection.\r\n");
break;
case "fget_large":
break;
case "fget_large":
fputs($s, "150 File status okay; about to open data connection.\r\n");
$transfer_type = $ascii? 'ASCII' : 'BINARY' ;
if ($GLOBALS['rest_pos'] == '5368709119') {
fputs($fs, "X");
} else {
fputs($fs, "Y");
}
$transfer_type = $ascii? 'ASCII' : 'BINARY' ;
if ($GLOBALS['rest_pos'] == '5368709119') {
fputs($fs, "X");
} else {
fputs($fs, "Y");
}
fputs($s, "226 Closing data Connection.\r\n");
break;
break;
case "mediumfile":
fputs($s, "150 File status okay; about to open data connection.\r\n");
for($i = 0; $i < 150; $i++){
@ -471,11 +471,17 @@ if ($pid) {
}elseif (preg_match('/^LIST no_exists\//', $buf, $matches)) {
fputs($s, "425 Error establishing connection\r\n");
}elseif (preg_match('/^REST (\d+)/', $buf, $matches)) {
$GLOBALS['rest_pos'] = $matches[1];
}elseif (preg_match('/^REST (\d+)/', $buf, $matches)) {
$GLOBALS['rest_pos'] = $matches[1];
fputs($s, "350 OK\r\n");
}elseif (preg_match('/^SIZE largefile/', $buf)) {
fputs($s, "213 5368709120\r\n");
}elseif (preg_match('/^SIZE largefile/', $buf)) {
fputs($s, "213 5368709120\r\n");
}elseif (preg_match('/^RNFR existing_file/', $buf, $matches)) {
fputs($s, "350 File or directory exists, ready for destination name\r\n");
}elseif (preg_match('/^RNFR nonexisting_file/', $buf, $matches)) {
fputs($s, "550 No such file or directory\r\n");
}elseif (preg_match('/^RNTO nonexisting_file/', $buf, $matches)) {
fputs($s, "250 Rename successful\r\n");
}elseif (preg_match('/^MLSD no_exists\//', $buf, $matches)) {
fputs($s, "425 Error establishing connection\r\n");
}elseif (preg_match("~^MLSD(?: ([A-Za-z./]+))?\r\n$~", $buf, $m)) {
@ -518,7 +524,7 @@ if ($pid) {
fputs($s, "226 Closing data Connection.\r\n");
fclose($fs);
}else {
}else {
fputs($s, "500 Syntax error, command unrecognized.\r\n");
dump_and_exit($buf);
}

View File

@ -53,7 +53,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_ibase_errcode, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_connect, 0, 0, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_connect, 0, 0, 0)
ZEND_ARG_INFO(0, database)
ZEND_ARG_INFO(0, username)
ZEND_ARG_INFO(0, password)
@ -63,7 +63,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_connect, 0, 0, 1)
ZEND_ARG_INFO(0, role)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_pconnect, 0, 0, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_pconnect, 0, 0, 0)
ZEND_ARG_INFO(0, database)
ZEND_ARG_INFO(0, username)
ZEND_ARG_INFO(0, password)
@ -1033,7 +1033,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
}
/* }}} */
/* {{{ proto resource ibase_connect(string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]])
/* {{{ proto resource ibase_connect([string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]]])
Open a connection to an InterBase database */
PHP_FUNCTION(ibase_connect)
{
@ -1041,7 +1041,7 @@ PHP_FUNCTION(ibase_connect)
}
/* }}} */
/* {{{ proto resource ibase_pconnect(string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]])
/* {{{ proto resource ibase_pconnect([string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]]])
Open a persistent connection to an InterBase database */
PHP_FUNCTION(ibase_pconnect)
{

View File

@ -0,0 +1,19 @@
--TEST--
Basic UConverter::getStandards() usage
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
function assertTrue($assertion, $msg) {
if (!$assertion) var_dump($msg);
}
$standards = UConverter::getStandards();
assertTrue(is_array($standards), '$standards must be an array');
assertTrue(count($standards) > 0, '$standards must not be empty');
assertTrue($standards === array_values($standards), '$standards keys must be numeric');
assertTrue($standards === array_unique($standards), '$standards values must be unique');
assertTrue(array_reduce($standards, function($carry, $item) { return $carry && is_string($item); }, true), '$standards values must be strings');
?>
===DONE===
--EXPECT--
===DONE===

View File

@ -37,7 +37,7 @@ AC_DEFUN([PHP_MBSTRING_EXTENSION], [
for dir in $PHP_MBSTRING_EXTRA_BUILD_DIRS; do
PHP_ADD_BUILD_DIR([$ext_builddir/$dir], 1)
done
for dir in $PHP_MBSTRING_EXTRA_INCLUDES; do
PHP_ADD_INCLUDE([$ext_srcdir/$dir])
PHP_ADD_INCLUDE([$ext_builddir/$dir])
@ -54,8 +54,8 @@ AC_DEFUN([PHP_MBSTRING_EXTENSION], [
out="php_config.h"
fi
fi
if test "$PHP_MBSTRING_BUNDLED_ONIG" = "1"; then
if test "$PHP_MBSTRING_BUNDLED_ONIG" = "1"; then
cp $ext_srcdir/oniguruma/src/oniguruma.h $ext_srcdir/oniguruma/oniguruma.h
fi
@ -83,12 +83,12 @@ AC_DEFUN([PHP_MBSTRING_SETUP_MBREGEX], [
AC_TRY_RUN([
#include <stdarg.h>
int foo(int x, ...) {
va_list va;
va_start(va, x);
va_arg(va, int);
va_arg(va, char *);
va_arg(va, double);
return 0;
va_list va;
va_start(va, x);
va_arg(va, int);
va_arg(va, char *);
va_arg(va, double);
return 0;
}
int main() { return foo(10, "", 3.14); }
], [php_cv_mbstring_stdarg=yes], [php_cv_mbstring_stdarg=no], [
@ -101,21 +101,21 @@ int main() { return foo(10, "", 3.14); }
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(long, 4)
AC_C_CONST
AC_HEADER_TIME
AC_HEADER_TIME
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
AC_CHECK_HEADER([stdarg.h], [
AC_DEFINE([HAVE_STDARG_PROTOTYPES], [1], [Define to 1 if you have the <stdarg.h> header file.])
], [])
AC_DEFINE([PHP_ONIG_BUNDLED], [1], [Define to 1 if the bundled oniguruma is used])
AC_DEFINE([HAVE_ONIG], [1], [Define to 1 if the oniguruma library is available])
AC_DEFINE([HAVE_ONIG], [1], [Define to 1 if the oniguruma library is available])
PHP_MBSTRING_ADD_CFLAG([-DNOT_RUBY])
PHP_MBSTRING_ADD_BUILD_DIR([oniguruma])
PHP_MBSTRING_ADD_BUILD_DIR([oniguruma/src])
PHP_MBSTRING_ADD_INCLUDE([oniguruma])
PHP_MBSTRING_ADD_CONFIG_HEADER([oniguruma/src/config.h])
PHP_MBSTRING_ADD_SOURCES([
oniguruma/src/ascii.c
oniguruma/src/ascii.c
oniguruma/src/big5.c
oniguruma/src/cp1251.c
oniguruma/src/euc_jp.c
@ -180,7 +180,7 @@ int main() { return foo(10, "", 3.14); }
PHP_CHECK_LIBRARY(onig, onig_init, [
PHP_ADD_LIBRARY_WITH_PATH(onig, $PHP_ONIG/$PHP_LIBDIR, MBSTRING_SHARED_LIBADD)
AC_DEFINE([HAVE_ONIG], [1], [Define to 1 if the oniguruma library is available])
AC_DEFINE([HAVE_ONIG], [1], [Define to 1 if the oniguruma library is available])
],[
AC_MSG_ERROR([Problem with oniguruma. Please check config.log for more information.])
], [
@ -214,135 +214,108 @@ return (int)(ONIG_ENCODING_KOI8 + 1);
])
AC_DEFUN([PHP_MBSTRING_SETUP_LIBMBFL], [
dnl libmbfl is required and can not be disabled
if test "$PHP_LIBMBFL" = "yes" || test "$PHP_LIBMBFL" = "no"; then
dnl
dnl Bundled libmbfl
dnl
PHP_MBSTRING_ADD_BUILD_DIR([libmbfl])
PHP_MBSTRING_ADD_BUILD_DIR([libmbfl/mbfl])
PHP_MBSTRING_ADD_BUILD_DIR([libmbfl/filters])
PHP_MBSTRING_ADD_BUILD_DIR([libmbfl/nls])
PHP_MBSTRING_ADD_INCLUDE([libmbfl])
PHP_MBSTRING_ADD_INCLUDE([libmbfl/mbfl])
PHP_MBSTRING_ADD_CONFIG_HEADER([libmbfl/config.h])
dnl
dnl Bundled libmbfl is required and can not be disabled
dnl
PHP_MBSTRING_ADD_BUILD_DIR([libmbfl])
PHP_MBSTRING_ADD_BUILD_DIR([libmbfl/mbfl])
PHP_MBSTRING_ADD_BUILD_DIR([libmbfl/filters])
PHP_MBSTRING_ADD_BUILD_DIR([libmbfl/nls])
PHP_MBSTRING_ADD_INCLUDE([libmbfl])
PHP_MBSTRING_ADD_INCLUDE([libmbfl/mbfl])
PHP_MBSTRING_ADD_CONFIG_HEADER([libmbfl/config.h])
PHP_MBSTRING_ADD_SOURCES([
libmbfl/filters/html_entities.c
libmbfl/filters/mbfilter_7bit.c
libmbfl/filters/mbfilter_ascii.c
libmbfl/filters/mbfilter_base64.c
libmbfl/filters/mbfilter_big5.c
libmbfl/filters/mbfilter_byte2.c
libmbfl/filters/mbfilter_byte4.c
libmbfl/filters/mbfilter_cp1251.c
libmbfl/filters/mbfilter_cp1252.c
libmbfl/filters/mbfilter_cp1254.c
libmbfl/filters/mbfilter_cp5022x.c
libmbfl/filters/mbfilter_cp51932.c
libmbfl/filters/mbfilter_cp850.c
libmbfl/filters/mbfilter_cp866.c
libmbfl/filters/mbfilter_cp932.c
libmbfl/filters/mbfilter_cp936.c
libmbfl/filters/mbfilter_gb18030.c
libmbfl/filters/mbfilter_euc_cn.c
libmbfl/filters/mbfilter_euc_jp.c
libmbfl/filters/mbfilter_euc_jp_2004.c
libmbfl/filters/mbfilter_euc_jp_win.c
libmbfl/filters/mbfilter_euc_kr.c
libmbfl/filters/mbfilter_euc_tw.c
libmbfl/filters/mbfilter_htmlent.c
libmbfl/filters/mbfilter_hz.c
libmbfl/filters/mbfilter_iso2022_jp_ms.c
libmbfl/filters/mbfilter_iso2022jp_2004.c
libmbfl/filters/mbfilter_iso2022jp_mobile.c
libmbfl/filters/mbfilter_iso2022_kr.c
libmbfl/filters/mbfilter_iso8859_1.c
libmbfl/filters/mbfilter_iso8859_10.c
libmbfl/filters/mbfilter_iso8859_13.c
libmbfl/filters/mbfilter_iso8859_14.c
libmbfl/filters/mbfilter_iso8859_15.c
libmbfl/filters/mbfilter_iso8859_16.c
libmbfl/filters/mbfilter_iso8859_2.c
libmbfl/filters/mbfilter_iso8859_3.c
libmbfl/filters/mbfilter_iso8859_4.c
libmbfl/filters/mbfilter_iso8859_5.c
libmbfl/filters/mbfilter_iso8859_6.c
libmbfl/filters/mbfilter_iso8859_7.c
libmbfl/filters/mbfilter_iso8859_8.c
libmbfl/filters/mbfilter_iso8859_9.c
libmbfl/filters/mbfilter_jis.c
libmbfl/filters/mbfilter_koi8r.c
libmbfl/filters/mbfilter_armscii8.c
libmbfl/filters/mbfilter_qprint.c
libmbfl/filters/mbfilter_sjis.c
libmbfl/filters/mbfilter_sjis_open.c
libmbfl/filters/mbfilter_sjis_mobile.c
libmbfl/filters/mbfilter_sjis_mac.c
libmbfl/filters/mbfilter_sjis_2004.c
libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.c
libmbfl/filters/mbfilter_ucs2.c
libmbfl/filters/mbfilter_ucs4.c
libmbfl/filters/mbfilter_uhc.c
libmbfl/filters/mbfilter_utf16.c
libmbfl/filters/mbfilter_utf32.c
libmbfl/filters/mbfilter_utf7.c
libmbfl/filters/mbfilter_utf7imap.c
libmbfl/filters/mbfilter_utf8.c
libmbfl/filters/mbfilter_utf8_mobile.c
libmbfl/filters/mbfilter_uuencode.c
libmbfl/filters/mbfilter_koi8u.c
libmbfl/mbfl/mbfilter.c
libmbfl/mbfl/mbfilter_8bit.c
libmbfl/mbfl/mbfilter_pass.c
libmbfl/mbfl/mbfilter_wchar.c
libmbfl/mbfl/mbfl_convert.c
libmbfl/mbfl/mbfl_encoding.c
libmbfl/mbfl/mbfl_filter_output.c
libmbfl/mbfl/mbfl_ident.c
libmbfl/mbfl/mbfl_language.c
libmbfl/mbfl/mbfl_memory_device.c
libmbfl/mbfl/mbfl_string.c
libmbfl/mbfl/mbfl_allocators.c
libmbfl/nls/nls_de.c
libmbfl/nls/nls_en.c
libmbfl/nls/nls_ja.c
libmbfl/nls/nls_kr.c
libmbfl/nls/nls_neutral.c
libmbfl/nls/nls_ru.c
libmbfl/nls/nls_uni.c
libmbfl/nls/nls_zh.c
libmbfl/nls/nls_hy.c
libmbfl/nls/nls_tr.c
libmbfl/nls/nls_ua.c
])
PHP_MBSTRING_ADD_CFLAG([-DHAVE_CONFIG_H])
PHP_MBSTRING_ADD_INSTALL_HEADERS([libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h])
else
dnl
dnl External libmfl
dnl
for inc in include include/mbfl-1.0 include/mbfl; do
if test -f "$PHP_LIBMBFL/$inc/mbfilter.h"; then
PHP_LIBMBFL_INCLUDE="$inc"
break
fi
done
if test -z "$PHP_LIBMBFL_INCLUDE"; then
AC_MSG_ERROR([mbfilter.h not found. Please reinstall libmbfl library.])
else
PHP_ADD_INCLUDE([$PHP_LIBMBFL_INCLUDE])
fi
PHP_CHECK_LIBRARY(mbfl, mbfl_buffer_converter_new, [
PHP_ADD_LIBRARY_WITH_PATH(mbfl, $PHP_LIBMBFL/$PHP_LIBDIR, MBSTRING_SHARED_LIBADD)
],[
AC_MSG_ERROR([Problem with libmbfl. Please check config.log for more information.])
], [
-L$PHP_LIBMBFL/$PHP_LIBDIR
])
fi
PHP_MBSTRING_ADD_SOURCES([
libmbfl/filters/html_entities.c
libmbfl/filters/mbfilter_7bit.c
libmbfl/filters/mbfilter_ascii.c
libmbfl/filters/mbfilter_base64.c
libmbfl/filters/mbfilter_big5.c
libmbfl/filters/mbfilter_byte2.c
libmbfl/filters/mbfilter_byte4.c
libmbfl/filters/mbfilter_cp1251.c
libmbfl/filters/mbfilter_cp1252.c
libmbfl/filters/mbfilter_cp1254.c
libmbfl/filters/mbfilter_cp5022x.c
libmbfl/filters/mbfilter_cp51932.c
libmbfl/filters/mbfilter_cp850.c
libmbfl/filters/mbfilter_cp866.c
libmbfl/filters/mbfilter_cp932.c
libmbfl/filters/mbfilter_cp936.c
libmbfl/filters/mbfilter_gb18030.c
libmbfl/filters/mbfilter_euc_cn.c
libmbfl/filters/mbfilter_euc_jp.c
libmbfl/filters/mbfilter_euc_jp_2004.c
libmbfl/filters/mbfilter_euc_jp_win.c
libmbfl/filters/mbfilter_euc_kr.c
libmbfl/filters/mbfilter_euc_tw.c
libmbfl/filters/mbfilter_htmlent.c
libmbfl/filters/mbfilter_hz.c
libmbfl/filters/mbfilter_iso2022_jp_ms.c
libmbfl/filters/mbfilter_iso2022jp_2004.c
libmbfl/filters/mbfilter_iso2022jp_mobile.c
libmbfl/filters/mbfilter_iso2022_kr.c
libmbfl/filters/mbfilter_iso8859_1.c
libmbfl/filters/mbfilter_iso8859_10.c
libmbfl/filters/mbfilter_iso8859_13.c
libmbfl/filters/mbfilter_iso8859_14.c
libmbfl/filters/mbfilter_iso8859_15.c
libmbfl/filters/mbfilter_iso8859_16.c
libmbfl/filters/mbfilter_iso8859_2.c
libmbfl/filters/mbfilter_iso8859_3.c
libmbfl/filters/mbfilter_iso8859_4.c
libmbfl/filters/mbfilter_iso8859_5.c
libmbfl/filters/mbfilter_iso8859_6.c
libmbfl/filters/mbfilter_iso8859_7.c
libmbfl/filters/mbfilter_iso8859_8.c
libmbfl/filters/mbfilter_iso8859_9.c
libmbfl/filters/mbfilter_jis.c
libmbfl/filters/mbfilter_koi8r.c
libmbfl/filters/mbfilter_armscii8.c
libmbfl/filters/mbfilter_qprint.c
libmbfl/filters/mbfilter_sjis.c
libmbfl/filters/mbfilter_sjis_open.c
libmbfl/filters/mbfilter_sjis_mobile.c
libmbfl/filters/mbfilter_sjis_mac.c
libmbfl/filters/mbfilter_sjis_2004.c
libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.c
libmbfl/filters/mbfilter_ucs2.c
libmbfl/filters/mbfilter_ucs4.c
libmbfl/filters/mbfilter_uhc.c
libmbfl/filters/mbfilter_utf16.c
libmbfl/filters/mbfilter_utf32.c
libmbfl/filters/mbfilter_utf7.c
libmbfl/filters/mbfilter_utf7imap.c
libmbfl/filters/mbfilter_utf8.c
libmbfl/filters/mbfilter_utf8_mobile.c
libmbfl/filters/mbfilter_uuencode.c
libmbfl/filters/mbfilter_koi8u.c
libmbfl/mbfl/mbfilter.c
libmbfl/mbfl/mbfilter_8bit.c
libmbfl/mbfl/mbfilter_pass.c
libmbfl/mbfl/mbfilter_wchar.c
libmbfl/mbfl/mbfl_convert.c
libmbfl/mbfl/mbfl_encoding.c
libmbfl/mbfl/mbfl_filter_output.c
libmbfl/mbfl/mbfl_ident.c
libmbfl/mbfl/mbfl_language.c
libmbfl/mbfl/mbfl_memory_device.c
libmbfl/mbfl/mbfl_string.c
libmbfl/mbfl/mbfl_allocators.c
libmbfl/nls/nls_de.c
libmbfl/nls/nls_en.c
libmbfl/nls/nls_ja.c
libmbfl/nls/nls_kr.c
libmbfl/nls/nls_neutral.c
libmbfl/nls/nls_ru.c
libmbfl/nls/nls_uni.c
libmbfl/nls/nls_zh.c
libmbfl/nls/nls_hy.c
libmbfl/nls/nls_tr.c
libmbfl/nls/nls_ua.c
])
PHP_MBSTRING_ADD_CFLAG([-DHAVE_CONFIG_H])
PHP_MBSTRING_ADD_INSTALL_HEADERS([libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h])
])
dnl
@ -359,15 +332,11 @@ PHP_ARG_ENABLE([mbregex_backtrack], [whether to check multibyte regex backtrack]
[ --disable-mbregex-backtrack
MBSTRING: Disable multibyte regex backtrack check], yes, no)
PHP_ARG_WITH(libmbfl, [for external libmbfl],
[ --with-libmbfl[=DIR] MBSTRING: Use external libmbfl. DIR is the libmbfl base
install directory [BUNDLED]], no, no)
PHP_ARG_WITH(onig, [for external oniguruma],
[ --with-onig[=DIR] MBSTRING: Use external oniguruma. DIR is the oniguruma install prefix.
If DIR is not set, the bundled oniguruma will be used], no, no)
if test "$PHP_MBSTRING" != "no"; then
if test "$PHP_MBSTRING" != "no"; then
AC_DEFINE([HAVE_MBSTRING],1,[whether to have multibyte string support])
PHP_MBSTRING_ADD_BASE_SOURCES([mbstring.c php_unicode.c mb_gpc.c])
@ -375,7 +344,7 @@ if test "$PHP_MBSTRING" != "no"; then
if test "$PHP_MBREGEX" != "no"; then
PHP_MBSTRING_SETUP_MBREGEX
fi
dnl libmbfl is required
PHP_MBSTRING_SETUP_LIBMBFL
PHP_MBSTRING_EXTENSION

View File

@ -1,7 +1,6 @@
// $Id$
// vim:ft=javascript
ARG_WITH("libmbfl", "use external libmbfl", "no");
ARG_ENABLE("mbstring", "multibyte string functions", "no");
ARG_ENABLE("mbregex", "multibyte regex support", "no");
ARG_ENABLE("mbregex-backtrack", "check multibyte regex backtrack", "yes");
@ -13,62 +12,48 @@ if (PHP_MBSTRING != "no") {
FSO.CopyFile("ext\\mbstring\\oniguruma\\src\\oniguruma.h",
"ext\\mbstring\\oniguruma\\oniguruma.h", true);
if (PHP_LIBMBFL != "no" &&
CHECK_HEADER_ADD_INCLUDE("mbfl/mbfilter.h", "CFLAGS_LIBMBFL", PHP_LIBMBFL + "\\include") &&
CHECK_LIB("mbfl.lib", "libmbfl", PHP_LIBMBFL + "\\lib")) {
STDOUT.WriteLine("Using bundled libmbfl...");
ADD_FLAG("LIBS_MBSTRING", get_define("LIBS_LIBMBFL"));
ADD_FLAG("LDFLAGS_MBSTRING", get_define("LDFLAGS_LIBMBFL"));
ADD_FLAG("CFLAGS_MBSTRING", get_define("CFLAGS_LIBMBFL") +
" /I ext/mbstring/oniguruma /D NOT_RUBY=1 \
/D HAVE_STDARG_PROTOTYPES=1 /D HAVE_STDLIB_H \
/D HAVE_STRICMP /D EXPORT /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_FLAG("CFLAGS_MBSTRING", "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
-Iext/mbstring/oniguruma /D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 \
/D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H /D HAVE_STDLIB_H \
/D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1")
PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h oniguruma/oniguruma.h php_mbregex.h php_onig_compat.h");
} else {
STDOUT.WriteLine("Using bundled libmbfl...");
FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.w32",
"ext\\mbstring\\libmbfl\\config.h", true);
ADD_FLAG("CFLAGS_MBSTRING", "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
-Iext/mbstring/oniguruma /D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 \
/D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H /D HAVE_STDLIB_H \
/D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1")
ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \
mbfilter_7bit.c mbfilter_ascii.c mbfilter_base64.c mbfilter_big5.c \
mbfilter_byte2.c mbfilter_byte4.c mbfilter_cp1251.c mbfilter_cp1252.c \
mbfilter_cp866.c mbfilter_cp932.c mbfilter_cp936.c mbfilter_cp51932.c \
mbfilter_euc_cn.c mbfilter_euc_jp.c mbfilter_euc_jp_win.c mbfilter_euc_kr.c \
mbfilter_euc_tw.c mbfilter_htmlent.c mbfilter_hz.c mbfilter_iso2022_kr.c \
mbfilter_iso8859_1.c mbfilter_iso8859_10.c mbfilter_iso8859_13.c \
mbfilter_iso8859_14.c mbfilter_iso8859_15.c mbfilter_iso8859_16.c \
mbfilter_iso8859_2.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c \
mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c \
mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_jis.c \
mbfilter_iso2022_jp_ms.c mbfilter_gb18030.c mbfilter_sjis_2004.c \
mbfilter_koi8r.c mbfilter_qprint.c mbfilter_sjis.c mbfilter_ucs2.c \
mbfilter_ucs4.c mbfilter_uhc.c mbfilter_utf16.c mbfilter_utf32.c \
mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c mbfilter_utf8_mobile.c \
mbfilter_koi8u.c mbfilter_cp1254.c mbfilter_euc_jp_2004.c \
mbfilter_uuencode.c mbfilter_armscii8.c mbfilter_cp850.c \
mbfilter_cp5022x.c mbfilter_sjis_open.c mbfilter_sjis_mobile.c \
mbfilter_sjis_mac.c \
mbfilter_iso2022jp_2004.c mbfilter_iso2022jp_mobile.c \
mbfilter_tl_jisx0201_jisx0208.c", "mbstring");
FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.w32",
"ext\\mbstring\\libmbfl\\config.h", true);
ADD_SOURCES("ext/mbstring/libmbfl/mbfl", "mbfilter.c mbfilter_8bit.c \
mbfilter_pass.c mbfilter_wchar.c mbfl_convert.c mbfl_encoding.c \
mbfl_filter_output.c mbfl_ident.c mbfl_language.c mbfl_memory_device.c \
mbfl_string.c mbfl_allocators.c", "mbstring");
ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \
mbfilter_7bit.c mbfilter_ascii.c mbfilter_base64.c mbfilter_big5.c \
mbfilter_byte2.c mbfilter_byte4.c mbfilter_cp1251.c mbfilter_cp1252.c \
mbfilter_cp866.c mbfilter_cp932.c mbfilter_cp936.c mbfilter_cp51932.c \
mbfilter_euc_cn.c mbfilter_euc_jp.c mbfilter_euc_jp_win.c mbfilter_euc_kr.c \
mbfilter_euc_tw.c mbfilter_htmlent.c mbfilter_hz.c mbfilter_iso2022_kr.c \
mbfilter_iso8859_1.c mbfilter_iso8859_10.c mbfilter_iso8859_13.c \
mbfilter_iso8859_14.c mbfilter_iso8859_15.c mbfilter_iso8859_16.c \
mbfilter_iso8859_2.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c \
mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c \
mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_jis.c \
mbfilter_iso2022_jp_ms.c mbfilter_gb18030.c mbfilter_sjis_2004.c \
mbfilter_koi8r.c mbfilter_qprint.c mbfilter_sjis.c mbfilter_ucs2.c \
mbfilter_ucs4.c mbfilter_uhc.c mbfilter_utf16.c mbfilter_utf32.c \
mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c mbfilter_utf8_mobile.c \
mbfilter_koi8u.c mbfilter_cp1254.c mbfilter_euc_jp_2004.c \
mbfilter_uuencode.c mbfilter_armscii8.c mbfilter_cp850.c \
mbfilter_cp5022x.c mbfilter_sjis_open.c mbfilter_sjis_mobile.c \
mbfilter_sjis_mac.c \
mbfilter_iso2022jp_2004.c mbfilter_iso2022jp_mobile.c \
mbfilter_tl_jisx0201_jisx0208.c", "mbstring");
ADD_SOURCES("ext/mbstring/libmbfl/nls", "nls_de.c nls_en.c nls_ja.c \
nls_kr.c nls_neutral.c nls_ru.c nls_uni.c nls_zh.c nls_hy.c \
nls_ua.c nls_tr.c", "mbstring");
ADD_SOURCES("ext/mbstring/libmbfl/mbfl", "mbfilter.c mbfilter_8bit.c \
mbfilter_pass.c mbfilter_wchar.c mbfl_convert.c mbfl_encoding.c \
mbfl_filter_output.c mbfl_ident.c mbfl_language.c mbfl_memory_device.c \
mbfl_string.c mbfl_allocators.c", "mbstring");
ADD_SOURCES("ext/mbstring/libmbfl/nls", "nls_de.c nls_en.c nls_ja.c \
nls_kr.c nls_neutral.c nls_ru.c nls_uni.c nls_zh.c nls_hy.c \
nls_ua.c nls_tr.c", "mbstring");
PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h oniguruma/oniguruma.h php_mbregex.h php_onig_compat.h libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h");
}
PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h oniguruma/oniguruma.h php_mbregex.h php_onig_compat.h libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h");
AC_DEFINE('HAVE_MBSTRING', 1, 'Have mbstring support');
AC_DEFINE('HAVE_MBSTR_CN', 1, 'CN');

View File

@ -4838,14 +4838,15 @@ static inline zend_long php_mb_ord(const char* str, size_t str_len, const char*
mbfl_convert_filter_feed_string(filter, (const unsigned char *) str, str_len);
mbfl_convert_filter_flush(filter);
mbfl_convert_filter_delete(filter);
if (dev.pos < 1 || filter->num_illegalchar || dev.buffer[0] >= MBFL_WCSGROUP_UCS4MAX) {
mbfl_convert_filter_delete(filter);
mbfl_wchar_device_clear(&dev);
return -1;
}
cp = dev.buffer[0];
mbfl_convert_filter_delete(filter);
mbfl_wchar_device_clear(&dev);
return cp;
}

View File

@ -436,7 +436,7 @@ const zend_function_entry mysqli_functions[] = {
PHP_FE(mysqli_fetch_field_direct, arginfo_mysqli_result_and_fieldnr)
PHP_FE(mysqli_fetch_lengths, arginfo_mysqli_only_result)
#ifdef MYSQLI_USE_MYSQLND
PHP_FE(mysqli_fetch_all, arginfo_mysqli_only_result)
PHP_FE(mysqli_fetch_all, arginfo_mysqli_fetch_array)
#endif
PHP_FE(mysqli_fetch_array, arginfo_mysqli_fetch_array)
PHP_FE(mysqli_fetch_assoc, arginfo_mysqli_only_result)
@ -616,7 +616,7 @@ const zend_function_entry mysqli_result_methods[] = {
PHP_FALIAS(fetch_fields, mysqli_fetch_fields, arginfo_mysqli_no_params)
PHP_FALIAS(fetch_field_direct, mysqli_fetch_field_direct, arginfo_class_mysqli_result_and_fieldnr)
#if defined(MYSQLI_USE_MYSQLND)
PHP_FALIAS(fetch_all, mysqli_fetch_all, arginfo_mysqli_no_params)
PHP_FALIAS(fetch_all, mysqli_fetch_all, arginfo_class_mysqli_fetch_array)
#endif
PHP_FALIAS(fetch_array, mysqli_fetch_array, arginfo_class_mysqli_fetch_array)
PHP_FALIAS(fetch_assoc, mysqli_fetch_assoc, arginfo_mysqli_no_params)

View File

@ -0,0 +1,24 @@
--TEST--
Bug #75434 Wrong reflection for mysqli_fetch_all function
--SKIPIF--
<?php
require_once('skipif.inc');
if (!extension_loaded("reflection")) die("skip reflection extension not available");
?>
--FILE--
<?php
$rf = new ReflectionFunction('mysqli_fetch_all');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());
$rm = new ReflectionMethod('mysqli_result', 'fetch_all');
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(2)
int(1)
int(1)
int(0)
===DONE===

View File

@ -124,9 +124,16 @@ isInternal: yes
isUserDefined: no
returnsReference: no
Modifiers: 256
Number of Parameters: 0
Number of Parameters: 1
Number of Required Parameters: 0
Inspecting parameter 'result_type' of method 'fetch_all'
isArray: no
allowsNull: no
isPassedByReference: no
isOptional: yes
isDefaultValueAvailable: no
Inspecting method 'fetch_array'
isFinal: no
isAbstract: no

View File

@ -3105,7 +3105,13 @@ static int zend_update_type_info(const zend_op_array *op_array,
}
j = zend_ssa_next_use(ssa_ops, ssa_ops[i].result_def, j);
}
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
if ((tmp & MAY_BE_ARRAY)
&& (tmp & (MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING))) {
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
} else {
/* invalid key type */
UPDATE_SSA_TYPE(t1, ssa_ops[i].op1_def);
}
COPY_SSA_OBJ_TYPE(ssa_ops[i].op1_use, ssa_ops[i].op1_def);
}
/* FETCH_LIST on a string behaves like FETCH_R on null */

View File

@ -0,0 +1,19 @@
--TEST--
Incorrect type inference
--FILE--
<?php
class PHP_CodeCoverage
{
private function addUncoveredFilesFromWhitelist()
{
foreach ($uncoveredFiles as $uncoveredFile) {
for ($i = 1; $i <= $lines; $i++) {
$data[$uncoveredFile][$i] = PHP_CodeCoverage_Driver::LINE_NOT_EXECUTED;
}
}
}
}
?>
OK
--EXPECT--
OK

View File

@ -364,17 +364,18 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_seal, 0, 0, 4)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(1, sealdata)
ZEND_ARG_INFO(1, ekeys) /* arary */
ZEND_ARG_INFO(1, ekeys) /* array */
ZEND_ARG_INFO(0, pubkeys) /* array */
ZEND_ARG_INFO(0, method)
ZEND_ARG_INFO(1, iv)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_openssl_open, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_open, 0, 0, 4)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(1, opendata)
ZEND_ARG_INFO(0, ekey)
ZEND_ARG_INFO(0, privkey)
ZEND_ARG_INFO(0, method)
ZEND_ARG_INFO(0, iv)
ZEND_END_ARG_INFO()
@ -5988,7 +5989,7 @@ PHP_FUNCTION(openssl_verify)
}
/* }}} */
/* {{{ proto int openssl_seal(string data, &string sealdata, &array ekeys, array pubkeys)
/* {{{ proto int openssl_seal(string data, &string sealdata, &array ekeys, array pubkeys [, string method [, &string iv]]))
Seals data */
PHP_FUNCTION(openssl_seal)
{
@ -6119,7 +6120,7 @@ clean_exit:
}
/* }}} */
/* {{{ proto bool openssl_open(string data, &string opendata, string ekey, mixed privkey)
/* {{{ proto bool openssl_open(string data, &string opendata, string ekey, mixed privkey [, string method [, string iv]])
Opens data */
PHP_FUNCTION(openssl_open)
{

View File

@ -0,0 +1,18 @@
--TEST--
Bug #75307 Wrong reflection for openssl_open function
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not available");
if (!extension_loaded("reflection")) die("skip reflection not available");
?>
--FILE--
<?php
$rf = new ReflectionFunction('openssl_open');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(6)
int(4)
===DONE===

View File

@ -12,7 +12,7 @@ $db = PDOTest::factory();
$client_version = $db->getAttribute(PDO::ATTR_CLIENT_VERSION);
$server_version = $db->getAttribute(PDO::ATTR_SERVER_VERSION);
if (version_compare($server_version, '7.4', '<') || version_compare($client_version, '7.4', '<')) {
if (version_compare($server_version, '7.4', '<') || version_compare($client_version, '7.4', '<') || version_compare($server_version, '10', '>=')) {
die('skip');
}

View File

@ -24,7 +24,7 @@ var_dump(pg_update($conn, 'foo', array('id' => 10), array('id' => 1), PGSQL_DML_
pg_update($conn, 'phptests.foo', array('id' => 100), array('id2' => 2));
var_dump(pg_update($conn, 'phptests.foo', array('id' => 100), array('id2' => 2), PGSQL_DML_STRING));
$rs = pg_query('SELECT * FROM foo UNION SELECT * FROM phptests.foo');
$rs = pg_query('SELECT * FROM foo UNION SELECT * FROM phptests.foo ORDER BY id');
while ($row = pg_fetch_assoc($rs)) {
var_dump($row);
}

View File

@ -3563,6 +3563,15 @@ PHP_FUNCTION(array_slice)
return;
}
if ((offset == 0) && (length >= num_in)) {
zend_array *ht = Z_ARRVAL_P(input);
if (preserve_keys || (HT_IS_PACKED(ht) && HT_IS_WITHOUT_HOLES(ht))) {
/* No real slicing, and the keys will match, so just copy */
ZVAL_COPY(return_value, input);
return;
}
}
/* Initialize returned array */
array_init_size(return_value, (uint32_t)length);
@ -4013,6 +4022,7 @@ PHP_FUNCTION(array_values)
zval *input, /* Input array */
*entry; /* An entry in the input array */
zend_array *arrval;
zend_long arrlen;
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY(input)
@ -4021,12 +4031,14 @@ PHP_FUNCTION(array_values)
arrval = Z_ARRVAL_P(input);
/* Return empty input as is */
if (!zend_hash_num_elements(arrval)) {
arrlen = zend_hash_num_elements(arrval);
if (!arrlen) {
RETURN_ZVAL(input, 1, 0);
}
/* Return vector-like packed arrays as-is */
if (HT_IS_PACKED(arrval) && HT_IS_WITHOUT_HOLES(arrval)) {
if (HT_IS_PACKED(arrval) && HT_IS_WITHOUT_HOLES(arrval) &&
arrval->nNextFreeElement == arrlen) {
RETURN_ZVAL(input, 1, 0);
}

View File

@ -0,0 +1,17 @@
--TEST--
array_values() preserves next index from source array when shallow-copying
--FILE--
<?php
$a = [1,2,3];
unset($a[2]);
$b = array_values($a);
$b[] = 4;
print_r($b);
--EXPECT--
Array
(
[0] => 1
[1] => 2
[2] => 4
)

View File

@ -837,7 +837,12 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse
zip_error_set(error, ZIP_ER_SEEK, EFBIG);
return NULL;
}
if ((flags & ZIP_CHECKCONS) && offset+size != eocd_offset) {
if (offset+size > buf_offset + eocd_offset) {
/* cdir spans past EOCD record */
zip_error_set(error, ZIP_ER_INCONS, 0);
return NULL;
}
if ((flags & ZIP_CHECKCONS) && offset+size != buf_offset + eocd_offset) {
zip_error_set(error, ZIP_ER_INCONS, 0);
return NULL;
}

View File

@ -52,7 +52,7 @@ if (!extension_loaded('pcre')) {
+-----------------------------------------------------------+
NO_PCRE_ERROR;
exit;
exit(1);
}
if (!function_exists('proc_open')) {
@ -65,7 +65,7 @@ if (!function_exists('proc_open')) {
+-----------------------------------------------------------+
NO_PROC_OPEN_ERROR;
exit;
exit(1);
}
// If timezone is not set, use UTC.