iliaa Thu Dec 25 13:57:29 2003 EDT
Added files: (Branch: PHP_4_3)
/php-src/tests/strings bug26703.phpt
Modified files:
/Zend zend_highlight.c
Log:
MFH: Fixed Bug #26703 (Certain characters inside strings incorrectly
treated as keywords).
Index: Zend/zend_highlight.c
diff -u Zend/zend_highlight.c:1.31.2.6 Zend/zend_highlight.c:1.31.2.7
--- Zend/zend_highlight.c:1.31.2.6 Sat Nov 29 14:05:59 2003
+++ Zend/zend_highlight.c Thu Dec 25 13:57:28 2003
@@ -134,14 +134,12 @@
continue;
break;
default:
- if (token.type==0) {
+ if (in_string) {
+ next_color =
syntax_highlighter_ini->highlight_string;
+ } else if (token.type == 0) {
next_color =
syntax_highlighter_ini->highlight_keyword;
} else {
- if (in_string) {
- next_color =
syntax_highlighter_ini->highlight_string;
- } else {
- next_color =
syntax_highlighter_ini->highlight_default;
- }
+ next_color =
syntax_highlighter_ini->highlight_default;
}
break;
}
Index: php-src/tests/strings/bug26703.phpt
+++ php-src/tests/strings/bug26703.phpt
--TEST--
Bug #26703 (Certain characters inside strings incorrectly treated as keywords)
--INI--
highlight.string=#DD0000
highlight.comment=#FF9900
highlight.keyword=#007700
highlight.bg=#FFFFFF
highlight.default=#0000BB
highlight.html=#000000
--FILE--
<?php
highlight_string('<?php echo "foo[] $a \n"; ?>');
?>
--EXPECT--
<code><font color="#000000">
<font color="#0000BB"><?php </font><font color="#007700">echo </font><font
color="#DD0000">"foo[] $a \n"</font><font color="#007700">; </font><font
color="#0000BB">?></font>
</font>
</code>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php