summaryrefslogtreecommitdiff
path: root/src/util/url.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-02 19:48:37 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-02 19:48:37 +0200
commit3a6ae694ecba19af06d84906facbcb5f7d51d72b (patch)
tree8f7c57fa0233300407436b6779c1c4b468d1bf01 /src/util/url.c
parent2ce37548c0b204eace2661992b23214cfd0e0b4b (diff)
downloadexchange-3a6ae694ecba19af06d84906facbcb5f7d51d72b.tar.gz
exchange-3a6ae694ecba19af06d84906facbcb5f7d51d72b.tar.bz2
exchange-3a6ae694ecba19af06d84906facbcb5f7d51d72b.zip
-work on #6948
Diffstat (limited to 'src/util/url.c')
-rw-r--r--src/util/url.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util/url.c b/src/util/url.c
index 5962a18b..3fbc4a04 100644
--- a/src/util/url.c
+++ b/src/util/url.c
@@ -365,4 +365,20 @@ TALER_url_absolute_raw (const char *proto,
}
+bool
+TALER_url_valid_charset (const char *url)
+{
+ for (unsigned int i = 0; '\0' != url[i]; i++)
+ {
+#define ALLOWED_CHARACTERS \
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/:&?-.,=_~%"
+ if (NULL == strchr (ALLOWED_CHARACTERS,
+ (int) url[i]))
+ return false;
+#undef ALLOWED_CHARACTERS
+ }
+ return true;
+}
+
+
/* end of url.c */