Explorar o código

Sanitize upload filename like URL

bel2125 %!s(int64=4) %!d(string=hai) anos
pai
achega
b2ed60c589
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/handle_form.inl

+ 2 - 0
src/handle_form.inl

@@ -55,6 +55,8 @@ url_encoded_field_found(const struct mg_connection *conn,
 			mg_cry_internal(conn, "%s: Cannot decode filename", __func__);
 			return MG_FORM_FIELD_STORAGE_SKIP;
 		}
+		remove_dot_segments(filename_dec);
+
 	} else {
 		filename_dec[0] = 0;
 	}