From: Ilia Alshanetsky Date: Thu, 25 Dec 2003 18:57:26 +0000 (+0000) Subject: Fixed Bug #26703 (Certain characters inside strings incorrectly treated as X-Git-Tag: php_ibase_before_split~484 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0688205940b47e118ce95d3ad7e9e05d616678fe;p=php Fixed Bug #26703 (Certain characters inside strings incorrectly treated as keywords). Original patch by vrana@php.net. --- diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c index fbcd63c618..fd9d2dd411 100644 --- a/Zend/zend_highlight.c +++ b/Zend/zend_highlight.c @@ -137,14 +137,12 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini 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; } diff --git a/tests/strings/bug26703.phpt b/tests/strings/bug26703.phpt new file mode 100644 index 0000000000..c86e1759d5 --- /dev/null +++ b/tests/strings/bug26703.phpt @@ -0,0 +1,18 @@ +--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-- +'); +?> +--EXPECT-- + +<?php echo "foo[] $a \n"; ?> + +