]> source.dussan.org Git - rspamd.git/commitdiff
Fix lua_util_is_utf_spoofed logic 1742/head
authorPaul Arthur <paul.arthur@flowerysong.com>
Sun, 9 Jul 2017 23:01:07 +0000 (23:01 +0000)
committerPaul Arthur <paul.arthur@flowerysong.com>
Sun, 9 Jul 2017 23:01:07 +0000 (23:01 +0000)
When compiled against libicu < 51 the list of allowed characters was
set to none, so all strings were flagged as spoofed.

Fixes #1689.

src/lua/lua_util.c

index ef2adfe81777e0b082755758d467e5606179770b..2e98d64fde50b0ce94db38035db5d9554c89f829 100644 (file)
@@ -1973,8 +1973,8 @@ lua_util_is_utf_spoofed (lua_State *L)
                        uspoof_setChecks (spc_sgl,
                                        USPOOF_ALL_CHECKS & ~USPOOF_WHOLE_SCRIPT_CONFUSABLE,
                                        &uc_err);
-                       uspoof_setAllowedChars (spc_sgl, allowed, &uc_err);
 #if U_ICU_VERSION_MAJOR_NUM >= 51
+                       uspoof_setAllowedChars (spc_sgl, allowed, &uc_err);
                        uspoof_setRestrictionLevel (spc_sgl, USPOOF_MODERATELY_RESTRICTIVE);
 #endif
                }