mirror of
https://github.com/akuker/RASCSI.git
synced 2024-09-30 20:56:19 +00:00
Fix bugs in the upload to images form (#1111)
* Fix formatting of the image subdir list for uploading * Fix upload path
This commit is contained in:
parent
282c639438
commit
ddf258db57
@ -15,11 +15,8 @@
|
|||||||
<input type="radio" name="destination" id="disk_images" value="disk_images" checked="checked">
|
<input type="radio" name="destination" id="disk_images" value="disk_images" checked="checked">
|
||||||
<label for="disk_images">{{ _("Disk Images") }}</label>
|
<label for="disk_images">{{ _("Disk Images") }}</label>
|
||||||
<select name="subdir" id="subdir">
|
<select name="subdir" id="subdir">
|
||||||
<option value="">images/</option>
|
|
||||||
{% for subdir, group in formatted_image_files.items() %}
|
{% for subdir, group in formatted_image_files.items() %}
|
||||||
{% if subdir != "/" %}
|
<option value="{{subdir}}"{% if subdir == "images/" %} selected{% endif %}>{{subdir}}</option>
|
||||||
<option value="{{subdir}}">images/{{subdir}}</option>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<input type="radio" name="destination" id="shared_files" value="shared_files">
|
<input type="radio" name="destination" id="shared_files" value="shared_files">
|
||||||
|
@ -990,7 +990,7 @@ def upload_file():
|
|||||||
return make_response(auth["msg"], 403)
|
return make_response(auth["msg"], 403)
|
||||||
|
|
||||||
destination = request.form.get("destination")
|
destination = request.form.get("destination")
|
||||||
subdir = request.form.get("subdir")
|
subdir = request.form.get("subdir").replace("images/", "", 1)
|
||||||
if destination == "disk_images":
|
if destination == "disk_images":
|
||||||
safe_path = is_safe_path(Path(subdir))
|
safe_path = is_safe_path(Path(subdir))
|
||||||
if not safe_path["status"]:
|
if not safe_path["status"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user