Skip to content

Commit

Permalink
Fixed bug #35147 (__HALT_COMPILER() breaks with --enable-zend-multibyte)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Nov 15, 2005
1 parent 5519008 commit a8c6b99
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down
1 change: 1 addition & 0 deletions Zend/zend_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion Zend/zend_language_scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
12 changes: 7 additions & 5 deletions Zend/zend_multibyte.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion pear/Makefile.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down

0 comments on commit a8c6b99

Please sign in to comment.