php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #50662
Patch echo-tags-test revision 2010-11-19 11:33 UTC by kanenas at comcast dot net
revision 2010-10-22 11:06 UTC by kanenas at comcast dot net
Patch echo_tags-patch revision 2010-11-19 11:31 UTC by ww dot galen at gmail dot com
revision 2010-10-22 11:00 UTC by kanenas at comcast dot net
Patch echo-tags-test-2 revision 2010-10-22 11:07 UTC by kanenas at comcast dot net

Patch echo_tags-patch for Scripting Engine problem Bug #50662

Patch version 2010-10-22 11:00 UTC

Return to Bug #50662 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: kanenas@comcast.net

--- configure.orig	2010-10-15 21:03:40.000000000 -0700
+++ configure	2010-10-15 21:06:15.000000000 -0700
@@ -20232,11 +20232,44 @@
 
 
 fi
 
 
-php_enable_short_tags=yes
+php_enable_echo_tags=yes
+
+echo $ac_n "checking whether to enable echo tags by default""... $ac_c" 1>&6
+echo "configure:20241: checking whether to enable echo tags by default" >&5
+# Check whether --enable-echo-tags or --disable-echo-tags was given.
+if test "${enable_echo_tags+set}" = set; then
+  enableval="$enable_echo_tags"
+  PHP_ECHO_TAGS=$enableval
+else
+  
+  PHP_ECHO_TAGS=yes
+
+  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
+    PHP_ECHO_TAGS=$PHP_ENABLE_ALL
+  fi
+
+fi
+
+
+ext_output=$PHP_ECHO_TAGS
+echo "$ac_t""$ext_output" 1>&6
+
+
+if test "$PHP_ECHO_TAGS" = "yes"; then
+  cat >> confdefs.h <<\EOF
+#define DEFAULT_ECHO_TAG "1"
+EOF
+
+else
+  cat >> confdefs.h <<\EOF
+#define DEFAULT_ECHO_TAG "0"
+EOF
+
+fi
 
 echo $ac_n "checking whether to enable short tags by default""... $ac_c" 1>&6
 echo "configure:20241: checking whether to enable short tags by default" >&5
 # Check whether --enable-short-tags or --disable-short-tags was given.
 if test "${enable_short_tags+set}" = set; then
@@ -20254,13 +20287,10 @@
 
 
 ext_output=$PHP_SHORT_TAGS
 echo "$ac_t""$ext_output" 1>&6
 
-
-
-
 if test "$PHP_SHORT_TAGS" = "yes"; then
   cat >> confdefs.h <<\EOF
 #define DEFAULT_SHORT_OPEN_TAG "1"
 EOF
 
@@ -30640,10 +30670,11 @@
       THIS_INCLUDE=$i/include/db4.7/db.h
       break
     elif test -f "$i/include/db47/db.h"; then
       THIS_PREFIX=$i
       THIS_INCLUDE=$i/include/db47/db.h
+      DBDIR=/db47
       break
     elif test -f "$i/include/db4.6/db.h"; then
       THIS_PREFIX=$i
       THIS_INCLUDE=$i/include/db4.6/db.h
       break
@@ -30672,15 +30703,15 @@
   
   if test -z "$THIS_INCLUDE"; then
     { echo "configure: error: DBA: Could not find necessary header file(s)." 1>&2; exit 1; }
   fi
   for LIB in db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db; do
-    if test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.a || test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then
+    if test -f $THIS_PREFIX/$PHP_LIBDIR${DBDIR}/lib$LIB.a || test -f $THIS_PREFIX/$PHP_LIBDIR${DBDIR}/lib$LIB.$SHLIB_SUFFIX_NAME; then
       lib_found="";
       
   old_LDFLAGS=$LDFLAGS
-  LDFLAGS="-L$THIS_PREFIX/$PHP_LIBDIR $LDFLAGS"
+  LDFLAGS="-L$THIS_PREFIX/$PHP_LIBDIR$DBDIR $LDFLAGS"
   old_LIBS=$LIBS
   LIBS="-l$LIB $LIBS"
   
         cat > conftest.$ac_ext <<EOF
 #line 30683 "configure"
--- main/main.c.orig	2010-03-12 02:28:59.000000000 -0800
+++ main/main.c	2010-10-14 18:36:35.000000000 -0700
@@ -435,10 +435,11 @@
 
 	STD_PHP_INI_BOOLEAN("allow_call_time_pass_reference",	"1",	PHP_INI_SYSTEM|PHP_INI_PERDIR,		OnUpdateBool,	allow_call_time_pass_reference,	zend_compiler_globals,	compiler_globals)
 	STD_PHP_INI_BOOLEAN("asp_tags",				"0",		PHP_INI_SYSTEM|PHP_INI_PERDIR,		OnUpdateBool,			asp_tags,				zend_compiler_globals,	compiler_globals)
 	STD_PHP_INI_ENTRY_EX("display_errors",		"1",		PHP_INI_ALL,		OnUpdateDisplayErrors,	display_errors,			php_core_globals,	core_globals, display_errors_mode)
 	STD_PHP_INI_BOOLEAN("display_startup_errors",	"0",	PHP_INI_ALL,		OnUpdateBool,			display_startup_errors,	php_core_globals,	core_globals)
+	STD_PHP_INI_BOOLEAN("echo_tag",	DEFAULT_ECHO_TAG,		PHP_INI_SYSTEM|PHP_INI_PERDIR,		OnUpdateBool,			echo_tags,				zend_compiler_globals,	compiler_globals)
 	STD_PHP_INI_BOOLEAN("enable_dl",			"1",		PHP_INI_SYSTEM,		OnUpdateBool,			enable_dl,				php_core_globals,	core_globals)
 	STD_PHP_INI_BOOLEAN("expose_php",			"1",		PHP_INI_SYSTEM,		OnUpdateBool,			expose_php,				php_core_globals,	core_globals)
 	STD_PHP_INI_ENTRY("docref_root", 			"", 		PHP_INI_ALL,		OnUpdateString,			docref_root,			php_core_globals,	core_globals)
 	STD_PHP_INI_ENTRY("docref_ext",				"",			PHP_INI_ALL,		OnUpdateString,			docref_ext,				php_core_globals,	core_globals)
 	STD_PHP_INI_BOOLEAN("html_errors",			"1",		PHP_INI_ALL,		OnUpdateBool,			html_errors,			php_core_globals,	core_globals)
--- main/php_config.h.in.orig	2010-10-15 20:59:37.000000000 -0700
+++ main/php_config.h.in	2010-10-15 21:01:00.000000000 -0700
@@ -1234,10 +1234,13 @@
 
 /*   */
 #undef MAGIC_QUOTES
 
 /*   */
+#undef DEFAULT_ECHO_TAG
+
+/*   */
 #undef DEFAULT_SHORT_OPEN_TAG
 
 /*   */
 #undef DEFAULT_SHORT_OPEN_TAG
 
--- main/php_config.h.orig	2010-10-14 19:38:36.000000000 -0700
+++ main/php_config.h	2010-10-15 21:07:02.000000000 -0700
@@ -1235,14 +1235,17 @@
 
 /*   */
 #define MAGIC_QUOTES 0
 
 /*   */
-#define DEFAULT_SHORT_OPEN_TAG "1"
+#define DEFAULT_ECHO_TAG "1"
 
 /*   */
-#define DEFAULT_SHORT_OPEN_TAG "1"
+#define DEFAULT_SHORT_OPEN_TAG "0"
+
+/*   */
+#define DEFAULT_SHORT_OPEN_TAG "0"
 
 /* Whether you have dmalloc */
 /* #undef HAVE_DMALLOC */
 
 /* Whether to enable IPv6 support */
--- sapi/cli/php_cli_readline.c.orig	2010-01-03 01:23:27.000000000 -0800
+++ sapi/cli/php_cli_readline.c	2010-10-14 18:37:42.000000000 -0700
@@ -228,10 +228,11 @@
 				}
 				break;
 			case outside:
 				if ((CG(short_tags) && !strncmp(code+i-1, "<?", 2))
 				||  (CG(asp_tags) && !strncmp(code+i-1, "<%", 2))
+				||  (CG(echo_tags) && !strncmp(code+i-1, "<?=", 3))
 				||  (i > 3 && !strncmp(code+i-4, "<?php", 5))
 				) {
 					code_type = body;
 				}
 				break;
--- win32/build/config.w32.h.in.orig	2010-10-15 21:03:05.000000000 -0700
+++ win32/build/config.w32.h.in	2010-10-15 21:04:00.000000000 -0700
@@ -34,10 +34,11 @@
 /* PHP Runtime Configuration */
 #define PHP_URL_FOPEN 1
 #define PHP_SAFE_MODE 0
 #define MAGIC_QUOTES 0
 #define USE_CONFIG_FILE 1
+#define DEFAULT_ECHO_TAG "1"
 #define DEFAULT_SHORT_OPEN_TAG "1"
 
 /* Platform-Specific Configuration. Should not be changed. */
 #define PHP_SIGCHILD 0
 #define HAVE_LIBBIND 1
--- Zend/zend.c.orig	2010-10-14 18:43:40.000000000 -0700
+++ Zend/zend.c	2010-10-14 18:44:13.000000000 -0700
@@ -438,24 +438,27 @@
 }
 /* }}} */
 
 #ifdef ZTS
 static zend_bool asp_tags_default		  = 0;
+static zend_bool echo_tags_default		  = 1;
 static zend_bool short_tags_default		  = 1;
 static zend_bool ct_pass_ref_default	  = 1;
 static zend_uint compiler_options_default = ZEND_COMPILE_DEFAULT;
 #else
 # define asp_tags_default			0
+# define echo_tags_default			1
 # define short_tags_default			1
 # define ct_pass_ref_default		1
 # define compiler_options_default	ZEND_COMPILE_DEFAULT
 #endif
 
 static void zend_set_default_compile_time_values(TSRMLS_D) /* {{{ */
 {
 	/* default compile-time values */
 	CG(asp_tags) = asp_tags_default;
+	CG(echo_tags) = echo_tags_default;
 	CG(short_tags) = short_tags_default;
 	CG(allow_call_time_pass_reference) = ct_pass_ref_default;
 	CG(compiler_options) = compiler_options_default;
 }
 /* }}} */
@@ -732,10 +735,11 @@
 	*GLOBAL_FUNCTION_TABLE = *compiler_globals->function_table;
 	*GLOBAL_CLASS_TABLE = *compiler_globals->class_table;
 	*GLOBAL_CONSTANTS_TABLE = *executor_globals->zend_constants;
 
 	asp_tags_default = CG(asp_tags);
+	echo_tags_default = CG(echo_tags);
 	short_tags_default = CG(short_tags);
 	ct_pass_ref_default = CG(allow_call_time_pass_reference);
 	compiler_options_default = CG(compiler_options);
 
 	zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
--- Zend/zend_globals.h.orig	2010-10-14 18:44:53.000000000 -0700
+++ Zend/zend_globals.h	2010-10-14 18:45:04.000000000 -0700
@@ -102,10 +102,11 @@
 	HashTable *auto_globals;
 
 	zend_bool in_compilation;
 	zend_bool short_tags;
 	zend_bool asp_tags;
+	zend_bool echo_tags;
 	zend_bool allow_call_time_pass_reference;
 
 	zend_declarables declarables;
 
 	zend_bool unclean_shutdown;
--- Zend/zend_language_scanner.c.orig	2010-10-14 18:45:41.000000000 -0700
+++ Zend/zend_language_scanner.c	2010-10-15 21:44:55.000000000 -0700
@@ -959,11 +959,11 @@
 		YYCURSOR = ptr ? ptr + 1 : YYLIMIT;
 
 		if (YYCURSOR < YYLIMIT) {
 			switch (*YYCURSOR) {
 				case '?':
-					if (CG(short_tags) || !strncasecmp(YYCURSOR + 1, "php", 3)) { /* Assume [ \t\n\r] follows "php" */
+					if (CG(short_tags) || (CG(echo_tags) && *(YYCURSOR + 1) == '=') || !strncasecmp(YYCURSOR + 1, "php", 3)) { /* Assume [ \t\n\r] follows "php" */
 						break;
 					}
 					continue;
 				case '%':
 					if (CG(asp_tags)) {
@@ -1307,11 +1307,11 @@
 		++YYCURSOR;
 		YYDEBUG(46, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 1526 "Zend/zend_language_scanner.l"
 		{
-	if (CG(short_tags)) {
+	if (CG(short_tags) || CG(echo_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
 		zendlval->value.str.len = yyleng;
 		zendlval->type = IS_STRING;
 		BEGIN(ST_IN_SCRIPTING);
 		return T_OPEN_TAG_WITH_ECHO;
--- Zend/zend_language_scanner.l.orig	2010-10-14 18:49:59.000000000 -0700
+++ Zend/zend_language_scanner.l	2010-10-14 18:46:30.000000000 -0700
@@ -1522,11 +1522,11 @@
 	}
 }
 
 
 <INITIAL>"<?=" {
-	if (CG(short_tags)) {
+	if (CG(short_tags) || CG(echo_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
 		zendlval->value.str.len = yyleng;
 		zendlval->type = IS_STRING;
 		BEGIN(ST_IN_SCRIPTING);
 		return T_OPEN_TAG_WITH_ECHO;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 26 06:01:31 2024 UTC