File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ extern const char str_applicationoctetstream[];
4343const char * utils_getmime (const char * path );
4444void utils_addmime (const char * ext , const char * mime );
4545
46- char * utils_urldecode (const char * encoded );
46+ char * utils_urldecode (const char * encoded , size_t length );
4747int utils_searchexp (const char * haystack , const char * needleslist , const char * * rest );
4848
4949struct utils_parsestring_s
Original file line number Diff line number Diff line change @@ -137,11 +137,12 @@ const char *utils_getmime(const char *filepath)
137137}
138138
139139
140- char * utils_urldecode (const char * encoded )
140+ char * utils_urldecode (const char * encoded , size_t length )
141141{
142142 if (encoded == NULL )
143143 return NULL ;
144- int length = strlen (encoded );
144+ if (length == -1 )
145+ length = strlen (encoded );
145146 if (length == 0 )
146147 return NULL ;
147148 char * decoded = calloc (1 , length + 1 );
@@ -197,7 +198,7 @@ char *utils_urldecode(const char *encoded)
197198 offset = decoded ;
198199 }
199200 }
200- else if (* encoded == '?' )
201+ else if (* encoded == '?' || * encoded == '&' )
201202 {
202203 break ;
203204 }
You can’t perform that action at this time.
0 commit comments