cvs: ZendEngine2 / zend_ini_scanner.l

[email protected] ("Stanislav Malyshev")
Newsgroups php.zend-engine.cvs
Message-ID <cvsstas1221094158@cvsserver>
stas		Thu Sep 11 00:49:18 2008 UTC

  Modified files:              
    /ZendEngine2	zend_ini_scanner.l 
  Log:
  MF5: Fix BC issue with ini scanner.
  # Now in "": \LETTER is literal, \" is escaped ", value ending with \" is literal
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini_scanner.l?r1=1.56&r2=1.57&diff_format=u
Index: ZendEngine2/zend_ini_scanner.l
diff -u ZendEngine2/zend_ini_scanner.l:1.56 ZendEngine2/zend_ini_scanner.l:1.57
--- ZendEngine2/zend_ini_scanner.l:1.56	Sun Aug 17 21:51:36 2008
+++ ZendEngine2/zend_ini_scanner.l	Thu Sep 11 00:49:18 2008
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_ini_scanner.l,v 1.56 2008/08/17 21:51:36 lbarnaud Exp $ */
+/* $Id: zend_ini_scanner.l,v 1.57 2008/09/11 00:49:18 stas Exp $ */
 
 #include <errno.h>
 #include "zend.h"
@@ -244,21 +244,10 @@
 		if (*s == '\\') {
 			s++;
 			if (s >= end) {
+				*t++ = '\\';
 				continue;
 			}
 			switch (*s) {
-				case 'n':
-					*t++ = '\n';
-					Z_STRLEN_P(lval)--;
-					break;
-				case 'r':
-					*t++ = '\r';
-					Z_STRLEN_P(lval)--;
-					break;
-				case 't':
-					*t++ = '\t';
-					Z_STRLEN_P(lval)--;
-					break;
 				case '"':
 					if (*s != quote_type) {
 						*t++ = '\\';
@@ -325,7 +314,7 @@
 LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
 VALUE_CHARS         ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
 SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
-DOUBLE_QUOTES_CHARS ([^$"\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
+DOUBLE_QUOTES_CHARS ([^$"\\]|("\\"[^"])|{LITERAL_DOLLAR}|"\\"["][^\r\n])
 
 +<!*> := yyleng = YYCURSOR - SCNG(yy_text);
 
@@ -458,7 +447,11 @@
 	return '"';
 }
 
-<ST_DOUBLE_QUOTES>{DOUBLE_QUOTES_CHARS}+ { /* Escape double quoted string contents */
+<ST_DOUBLE_QUOTES>{DOUBLE_QUOTES_CHARS}+("\\"["])? { /* Escape double quoted string contents */
+	if(yyleng > 1 && yytext[yyleng-1] == '"' && yytext[yyleng-2] == '\\') {
+		yyless(yyleng-1);
+		yyleng--;
+	}
 	zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
 	return TC_QUOTED_STRING;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.