[Pkg-php-commits] [php/debian-sid] Add 'deprecate_short_open_tag' patch which warns if a script uses short open tags

Ondřej Surý ondrej at sury.org
Sun Feb 7 23:17:14 UTC 2010


---
 debian/patches/deprecate_short_open_tag |   36 +++++++++++++++++++++++++++++++
 debian/patches/series                   |    1 +
 2 files changed, 37 insertions(+), 0 deletions(-)
 create mode 100644 debian/patches/deprecate_short_open_tag

diff --git a/debian/patches/deprecate_short_open_tag b/debian/patches/deprecate_short_open_tag
new file mode 100644
index 0000000..57a79c6
--- /dev/null
+++ b/debian/patches/deprecate_short_open_tag
@@ -0,0 +1,36 @@
+--- a/Zend/zend_language_scanner.l
++++ b/Zend/zend_language_scanner.l
+@@ -1513,6 +1513,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
+ 
+ <INITIAL>"<?=" {
+ 	if (CG(short_tags)) {
++		zend_error(E_DEPRECATED, "Usage of short open tag <? is not recommended and will be disabled by default in future versions of PHP");
+ 		zendlval->value.str.val = yytext; /* no copying - intentional */
+ 		zendlval->value.str.len = yyleng;
+ 		zendlval->type = IS_STRING;
+@@ -1549,6 +1550,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
+ 
+ <INITIAL>"<?" {
+ 	if (CG(short_tags)) {
++		zend_error(E_DEPRECATED, "Usage of short open tag <? is not recommended and will be disabled by default in future versions of PHP");
+ 		zendlval->value.str.val = yytext; /* no copying - intentional */
+ 		zendlval->value.str.len = yyleng;
+ 		zendlval->type = IS_STRING;
+--- a/Zend/zend_language_scanner.c
++++ b/Zend/zend_language_scanner.c
+@@ -1019,6 +1019,7 @@ yy6:
+ #line 1550 "Zend/zend_language_scanner.l"
+ 		{
+ 	if (CG(short_tags)) {
++		zend_error(E_DEPRECATED, "Usage of short open tag <? is not recommended and will be disabled by default in future versions of PHP");
+ 		zendlval->value.str.val = yytext; /* no copying - intentional */
+ 		zendlval->value.str.len = yyleng;
+ 		zendlval->type = IS_STRING;
+@@ -1298,6 +1299,7 @@ yy45:
+ #line 1514 "Zend/zend_language_scanner.l"
+ 		{
+ 	if (CG(short_tags)) {
++		zend_error(E_DEPRECATED, "Usage of short open tag <? is not recommended and will be disabled by default in future versions of PHP");
+ 		zendlval->value.str.val = yytext; /* no copying - intentional */
+ 		zendlval->value.str.len = yyleng;
+ 		zendlval->type = IS_STRING;
diff --git a/debian/patches/series b/debian/patches/series
index 80bef66..11e0542 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -35,3 +35,4 @@ mssql-null-exception.patch
 exif_read_data-segfault.patch
 sybase-alias.patch
 strcmp_null-OnUpdateErrorLog.patch
+deprecate_short_open_tag
-- 
1.6.3.3





More information about the Pkg-php-commits mailing list