mirror of
https://git.zx2c4.com/cgit
synced 2025-09-03 07:45:29 +00:00
Handle %xx encoding in querystring
Convert valid %xx expressions in querystring to ascii, ignore invalid expressions (i.e. eat the three characters %xx). Signed-off-by: Lars Hjemli <larsh@hal-2004.(none)>
This commit is contained in:
13
shared.c
13
shared.c
@@ -113,3 +113,16 @@ void *cgit_free_commitinfo(struct commitinfo *info)
|
||||
free(info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int hextoint(char c)
|
||||
{
|
||||
if (c >= 'a' && c <= 'f')
|
||||
return 10 + c - 'a';
|
||||
else if (c >= 'A' && c <= 'F')
|
||||
return 10 + c - 'A';
|
||||
else if (c >= '0' && c <= '9')
|
||||
return c - '0';
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user