1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fixed bug #35147 (__HALT_COMPILER() breaks with --enable-zend-multibyte)

This commit is contained in:
Dmitry Stogov
2005-11-15 13:29:39 +00:00
parent 5519008169
commit a8c6b992b8
6 changed files with 17 additions and 7 deletions

2
NEWS
View File

@@ -9,6 +9,8 @@ PHP NEWS
- Fixed bug #35179 (tokenizer extension needs T_HALT_COMPILER). (Greg)
- Fixed bug #35176 (include()/require()/*_once() produce wrong error messages
about main()). (Dmitry)
- Fixed bug #35147 (__HALT_COMPILER() breaks with --enable-zend-multibyte).
(Dmitry, Moriyoshi)
- Fixed bug #35142 (SOAP Client/Server Complex Object Support). (Dmitry)
- Fixed bug #35135 (PDOStatment without related PDO object may crash). (Ilia)
- Fixed bug #35091 (SoapClient leaks memory). (Dmitry)

View File

@@ -78,6 +78,9 @@ static ZEND_INI_MH(OnUpdateErrorReporting)
ZEND_INI_BEGIN()
ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting)
STD_ZEND_INI_BOOLEAN("zend.ze1_compatibility_mode", "0", ZEND_INI_ALL, OnUpdateBool, ze1_compatibility_mode, zend_executor_globals, executor_globals)
#ifdef ZEND_MULTIBYTE
STD_ZEND_INI_BOOLEAN("detect_unicode", "1", ZEND_INI_ALL, OnUpdateBool, detect_unicode, zend_compiler_globals, compiler_globals)
#endif
ZEND_INI_END()

View File

@@ -135,6 +135,7 @@ struct _zend_compiler_globals {
#ifdef ZEND_MULTIBYTE
zend_encoding **script_encoding_list;
int script_encoding_list_size;
zend_bool detect_unicode;
zend_encoding *internal_encoding;

View File

@@ -506,7 +506,9 @@ ZEND_API int zend_get_scanned_file_offset(TSRMLS_D)
return zend_stream_ftell(yyin TSRMLS_CC) - offset_from_the_end;
} else {
return -1;
/* The entire file is in the buffer; probably zend multibyte
is enabled */
return (yy_c_buf_p - (YY_CURRENT_BUFFER)->yy_ch_buf);
}
}

View File

@@ -994,11 +994,13 @@ static zend_encoding* zend_multibyte_find_script_encoding(zend_encoding *onetime
return onetime_encoding;
}
/* check out bom(byte order mark) and see if containing wchars */
script_encoding = zend_multibyte_detect_unicode(TSRMLS_C);
if (script_encoding != NULL) {
/* bom or wchar detection is prior to 'script_encoding' option */
return script_encoding;
if (CG(detect_unicode)) {
/* check out bom(byte order mark) and see if containing wchars */
script_encoding = zend_multibyte_detect_unicode(TSRMLS_C);
if (script_encoding != NULL) {
/* bom or wchar detection is prior to 'script_encoding' option */
return script_encoding;
}
}
/* if no script_encoding specified, just leave alone */

View File

@@ -3,7 +3,7 @@
peardir=$(PEAR_INSTALLDIR)
# Skip all php.ini files altogether
PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dsafe_mode=0 -derror_reporting=E_ALL
PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dsafe_mode=0 -derror_reporting=E_ALL -ddetect_unicode=0
install-pear-installer: $(top_builddir)/sapi/cli/php
@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) $(srcdir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)"