commit 0adcee6: [Minor] Css: Fix '\v' and '\f' handling

Vsevolod Stakhov vsevolod at highsecure.ru
Wed May 12 10:07:03 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-05-12 11:05:41 +0100
URL: https://github.com/rspamd/rspamd/commit/0adcee676505367509681d03ed4e7d611f6de6a0 (HEAD -> master)

[Minor] Css: Fix '\v' and '\f' handling

---
 src/libserver/css/css_parser.cxx    | 2 ++
 src/libserver/css/css_tokeniser.cxx | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/libserver/css/css_parser.cxx b/src/libserver/css/css_parser.cxx
index 9f93a7e25..774a65cfc 100644
--- a/src/libserver/css/css_parser.cxx
+++ b/src/libserver/css/css_parser.cxx
@@ -837,6 +837,8 @@ TEST_SUITE("css parser") {
 			"tt{color:#1e3482}",
 			"tt{unicode-range: u+0049-u+004a,u+0020;}",
 			"@import url(https://fonts.googleapis.com/css?family=arial:300,400,7000;",
+			"tt{color:black;\v}",
+			"tt{color:black;\f}",
 		};
 
 		rspamd_mempool_t *pool = rspamd_mempool_new(rspamd_mempool_suggest_size(),
diff --git a/src/libserver/css/css_tokeniser.cxx b/src/libserver/css/css_tokeniser.cxx
index d07b017a3..0b1467d8f 100644
--- a/src/libserver/css/css_tokeniser.cxx
+++ b/src/libserver/css/css_tokeniser.cxx
@@ -536,7 +536,7 @@ auto css_tokeniser::next_token(void) -> struct css_parser_token
 		case '\t':
 		case '\n':
 		case '\r':
-		case '\v': {
+		case '\f': {
 			/* Consume as much space as we can */
 			while (i < input.size() && g_ascii_isspace(input[i])) {
 				i++;


More information about the Commits mailing list