summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--Zend/zend.c3
-rw-r--r--Zend/zend_globals.h1
-rw-r--r--Zend/zend_language_scanner.l4
-rw-r--r--Zend/zend_multibyte.c12
-rw-r--r--pear/Makefile.frag2
6 files changed, 17 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index bb6e67f35b..d2d23156b5 100644
--- a/NEWS
+++ b/NEWS
@@ -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)
diff --git a/Zend/zend.c b/Zend/zend.c
index 2c790bf1b8..d9504d37fa 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -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()
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h
index bdbf72e659..198b3640c6 100644
--- a/Zend/zend_globals.h
+++ b/Zend/zend_globals.h
@@ -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;
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 111af67fcf..5fd23092ab 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -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);
}
}
diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c
index d7a444b32e..348d47f96f 100644
--- a/Zend/zend_multibyte.c
+++ b/Zend/zend_multibyte.c
@@ -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 */
diff --git a/pear/Makefile.frag b/pear/Makefile.frag
index 492f4e1af5..a8b1d68e44 100644
--- a/pear/Makefile.frag
+++ b/pear/Makefile.frag
@@ -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)"