--- embedaddon/php/ext/pcre/php_pcre.c 2012/02/21 23:47:59 1.1.1.1 +++ embedaddon/php/ext/pcre/php_pcre.c 2012/05/29 12:34:45 1.1.1.2 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_pcre.c,v 1.1.1.1 2012/02/21 23:47:59 misho Exp $ */ +/* $Id: php_pcre.c,v 1.1.1.2 2012/05/29 12:34:45 misho Exp $ */ #include "php.h" #include "php_ini.h" @@ -507,7 +507,7 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAME long flags = 0; /* Match control flags */ long start_offset = 0; /* Where the new search starts */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ((global) ? "ssz|ll" : "ss|zll"), ®ex, ®ex_len, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|zll", ®ex, ®ex_len, &subject, &subject_len, &subpats, &flags, &start_offset) == FAILURE) { RETURN_FALSE; } @@ -609,7 +609,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); /* Allocate match sets array and initialize the values. */ - if (global && subpats_order == PREG_PATTERN_ORDER) { + if (global && subpats && subpats_order == PREG_PATTERN_ORDER) { match_sets = (zval **)safe_emalloc(num_subpats, sizeof(zval *), 0); for (i=0; i