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)>
此提交包含在:
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;
|
||||
}
|
||||
|
||||
|
新增問題並參考
封鎖使用者