summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2021-10-07 12:00:20 +0000
committerYann Ylavic <ylavic@apache.org>2021-10-07 12:00:20 +0000
commit48b5dfd6968cb076537b605d368d5fd889ebae86 (patch)
treede137b4c860852adaa242d81de99a2293d4005f6 /include
parent7ecfc5b3a8f6e33ca5fb41f3c1c336c957646a19 (diff)
downloadhttpd-48b5dfd6968cb076537b605d368d5fd889ebae86.tar.gz
core: Add ap_unescape_url_ex() for better decoding control, and deprecate
unused AP_NORMALIZE_DROP_PARAMETERS flag. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893971 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r--include/ap_mmn.h3
-rw-r--r--include/httpd.h14
2 files changed, 16 insertions, 1 deletions
diff --git a/include/ap_mmn.h b/include/ap_mmn.h
index 496bc4b24f..8dbd8f7f31 100644
--- a/include/ap_mmn.h
+++ b/include/ap_mmn.h
@@ -693,6 +693,9 @@
* adding ap_proxy_tunnel_conn_bytes_{in,out}().
* 20210924.1 (2.5.1-dev) Add ap_proxy_fill_error_brigade()
* 20210926.0 (2.5.1-dev) Add dav_get_liveprop_element(), remove DAV_PROP_ELEMENT.
+ * 20210926.1 (2.5.1-dev) Add ap_unescape_url_ex() and deprecate
+ * AP_NORMALIZE_DROP_PARAMETERS
+ *
*/
#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
diff --git a/include/httpd.h b/include/httpd.h
index 5a4a61979d..e5375d77c2 100644
--- a/include/httpd.h
+++ b/include/httpd.h
@@ -1802,6 +1802,18 @@ AP_DECLARE(int) ap_unescape_url(char *url);
*/
AP_DECLARE(int) ap_unescape_url_keep2f(char *url, int decode_slashes);
+#define AP_UNESCAPE_URL_KEEP_UNRESERVED (1u << 0)
+#define AP_UNESCAPE_URL_FORBID_SLASHES (1u << 1)
+#define AP_UNESCAPE_URL_KEEP_SLASHES (1u << 2)
+
+/**
+ * Unescape a URL, with options
+ * @param url The url to unescape
+ * @param flags Bitmask of AP_UNESCAPE_URL_* flags
+ * @return 0 on success, non-zero otherwise
+ */
+AP_DECLARE(int) ap_unescape_url_ex(char *url, unsigned int flags);
+
/**
* Unescape an application/x-www-form-urlencoded string
* @param query The query to unescape
@@ -1831,7 +1843,7 @@ AP_DECLARE(void) ap_no2slash_ex(char *name, int is_fs_path)
#define AP_NORMALIZE_NOT_ABOVE_ROOT (1u << 1)
#define AP_NORMALIZE_DECODE_UNRESERVED (1u << 2)
#define AP_NORMALIZE_MERGE_SLASHES (1u << 3)
-#define AP_NORMALIZE_DROP_PARAMETERS (1u << 4)
+#define AP_NORMALIZE_DROP_PARAMETERS (0) /* deprecated */
/**
* Remove all ////, /./ and /xx/../ substrings from a path, and more