mirror of
https://git.zx2c4.com/cgit
synced 2025-07-12 19:24:30 +02: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:
parent
05b13194b4
commit
52e605caf5
3 changed files with 36 additions and 0 deletions
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue