From af964e8929407c43e6c45c2bd3f1a0c534b2f0cc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 26 Dec 2009 02:07:44 +0100 Subject: uri: added function uri_safe_local() --- src/uri.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/uri.h') diff --git a/src/uri.h b/src/uri.h index 46d36308..857080f8 100644 --- a/src/uri.h +++ b/src/uri.h @@ -35,6 +35,18 @@ G_GNUC_PURE const char * uri_get_suffix(const char *uri); +/** + * Returns true if this is a safe "local" URI: + * + * - non-empty + * - does not begin or end with a slash + * - no double slashes + * - no path component begins with a dot + */ +G_GNUC_PURE +bool +uri_safe_local(const char *uri); + /** * Removes HTTP username and password from the URI. This may be * useful for displaying an URI without disclosing secrets. Returns -- cgit v1.2.3