Fixes: #10271
Backport: firefly
This got broken by the fix for #8702. Since we now only url_decode if
we're in query, we need to specify that we're in query when decoding
these args.
Reported-by: Georgios Dimitrakakis <giorgis@acmac.uoc.gr>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
}
string substr, nameval;
substr = str.substr(pos, fpos - pos);
- url_decode(substr, nameval);
+ url_decode(substr, nameval, true);
NameVal nv(nameval);
int ret = nv.parse();
if (ret >= 0) {
return hex_table.to_num(c);
}
-bool url_decode(string& src_str, string& dest_str)
+bool url_decode(string& src_str, string& dest_str, bool in_query)
{
const char *src = src_str.c_str();
char dest[src_str.size() + 1];
int pos = 0;
char c;
- bool in_query = false;
while (*src) {
if (*src != '%') {
if (!in_query || *src != '+') {
extern bool verify_object_permission(struct req_state *s, int perm);
/** Convert an input URL into a sane object name
* by converting %-escaped strings into characters, etc*/
-extern bool url_decode(string& src_str, string& dest_str);
+extern bool url_decode(string& src_str, string& dest_str, bool in_query = false);
extern void url_encode(const string& src, string& dst);
extern void calc_hmac_sha1(const char *key, int key_len,