Commit bd4bfe35 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 1160809: Validate the MIME type before uploading attachments

r=dkl a=glob
parent 8ff02d6a
...@@ -68,6 +68,9 @@ ...@@ -68,6 +68,9 @@
<label for="manual">enter manually</label>: <label for="manual">enter manually</label>:
<input type="text" name="contenttypeentry" id="contenttypeentry" <input type="text" name="contenttypeentry" id="contenttypeentry"
size="30" maxlength="200" size="30" maxlength="200"
pattern="([% constants.LEGAL_CONTENT_TYPES.join('|') FILTER html %])/.+"
title="The content type must be of the form 'type/subtype', where 'type'
is one of: [% constants.LEGAL_CONTENT_TYPES.join(', ') FILTER html %]"
onchange="if (this.value) this.form.contenttypemethod[2].checked = true;"> onchange="if (this.value) this.form.contenttypemethod[2].checked = true;">
</td> </td>
</tr> </tr>
......
...@@ -94,6 +94,9 @@ ...@@ -94,6 +94,9 @@
<label for="contenttypeentry">MIME Type:</label> <label for="contenttypeentry">MIME Type:</label>
<input type="text" size="20" class="text block[% editable_or_hide %]" <input type="text" size="20" class="text block[% editable_or_hide %]"
id="contenttypeentry" name="contenttypeentry" id="contenttypeentry" name="contenttypeentry"
pattern="([% constants.LEGAL_CONTENT_TYPES.join('|') FILTER html %])/.+"
title="The content type must be of the form 'type/subtype', where 'type'
is one of: [% constants.LEGAL_CONTENT_TYPES.join(', ') FILTER html %]"
value="[% attachment.contenttype FILTER html %]"> value="[% attachment.contenttype FILTER html %]">
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment