commit 6007d9d: [Minor] Add function to test character for domain safety

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Feb 7 15:14:09 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-02-06 14:17:59 +0000
URL: https://github.com/rspamd/rspamd/commit/6007d9d998b15934641b002c9d99ffd43a9a70cf

[Minor] Add function to test character for domain safety

---
 src/libserver/url.c | 6 ++++++
 src/libserver/url.h | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/src/libserver/url.c b/src/libserver/url.c
index 4dcd11c9e..421c8a181 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -3323,3 +3323,9 @@ rspamd_url_encode (struct rspamd_url *url, gsize *pdlen,
 
 	return (const gchar *)dest;
 }
+
+gboolean
+rspamd_url_is_domain (int c)
+{
+	return is_domain ((guchar)c);
+}
diff --git a/src/libserver/url.h b/src/libserver/url.h
index 523fb2c1f..4c34be9e7 100644
--- a/src/libserver/url.h
+++ b/src/libserver/url.h
@@ -232,4 +232,12 @@ gsize rspamd_url_decode (gchar *dst, const gchar *src, gsize size);
 const gchar * rspamd_url_encode (struct rspamd_url *url, gsize *dlen,
 		rspamd_mempool_t *pool);
 
+
+/**
+ * Returns if a character is domain character
+ * @param c
+ * @return
+ */
+gboolean rspamd_url_is_domain (int c);
+
 #endif


More information about the Commits mailing list