sub _check_bug_file_loc {
my ($invocant, $url) = @_;
$url = '' if !defined($url);
- # On bug entry, if bug_file_loc is "http://", the default, use an
- # empty value instead. However, on bug editing people can set that
- # back if they *really* want to.
- if (!ref $invocant && $url eq 'http://') {
- $url = '';
- }
+ # TODO: Add validation. It has to be loose, since we have accepted `data:`,
+ # `javascript:` and any other values on the URL field.
return $url;
}
$vars->{'alias'} = formvalue('alias');
$vars->{'short_desc'} = formvalue('short_desc');
- $vars->{'bug_file_loc'} = formvalue('bug_file_loc', "http://");
+ $vars->{'bug_file_loc'} = formvalue('bug_file_loc');
$vars->{'keywords'} = formvalue('keywords');
$vars->{'dependson'} = formvalue('dependson');
$vars->{'blocked'} = formvalue('blocked');
The full URL (hostname/subpage) where the issue exists (if the URL is especially long
please just include it in the comments)
</div>
- <input type="text" name="bug_file_loc" id="bug_file_loc" size="80">
+ <input type="text" name="bug_file_loc" id="bug_file_loc" size="80" placeholder="https://">
</div>
<div class="form_section">
<th>Page to Update</th>
<td>
<input type="text" name="bug_file_loc" id="short_desc" size="60"
- value="[% bug_file_loc FILTER html %]">
+ value="[% bug_file_loc FILTER html %]" placeholder="https://">
</td>
</tr>
<td align="right"><strong>URL (optional):</strong></td>
<td colspan="3">
<input name="bug_file_loc" size="60"
- value="[% bug_file_loc FILTER html %]">
+ value="[% bug_file_loc FILTER html %]" placeholder="https://">
</td>
</tr>
<label for="bug_file_loc">URL:</label>
</th>
<td>
- <input type="text" name="bug_file_loc" id="bug_file_loc" size="60">
+ <input type="text" name="bug_file_loc" id="bug_file_loc" size="60" placeholder="https://">
</td>
</tr>
<th class="required">Full Web Page Address</th>
<td>
<input type="text" name="bug_file_loc" id="bug_file_loc" size="60"
- placeholder="e.g. http://www.example.com/page.html">
+ placeholder="https://">
</td>
</tr>
<th class="field_label">URL:</th>
<td colspan="3">
<input name="bug_file_loc" size="60"
- value="[% bug_file_loc FILTER html %]">
+ value="[% bug_file_loc FILTER html %]" placeholder="https://">
</td>
</tr>
<tr>
<td align="right"><strong>URL (optional):</strong></td>
<td colspan="3">
<input name="bug_file_loc" size="60"
- value="[% bug_file_loc FILTER html %]">
+ value="[% bug_file_loc FILTER html %]" placeholder="https://">
</td>
</tr>
</table>
<div class="field_desc">
Where would the user be sent when they click on the promotion?
</div>
- <input type="text" name="bug_file_loc" id="bug_file_loc" size="80">
+ <input type="text" name="bug_file_loc" id="bug_file_loc" size="80" placeholder="https://">
</div>
<div class="form_section">
The full URL (hostname/subpage) where the issue exists (if the URL is especially long
please just include it in the comments)
</div>
- <input type="text" name="bug_file_loc" id="bug_file_loc" size="80">
+ <input type="text" name="bug_file_loc" id="bug_file_loc" size="80" placeholder="https://">
</div>
<div class="form_section">
field = bug_fields.bug_file_loc
field_type = constants.FIELD_TYPE_FREETEXT
hide_on_view = bug.bug_file_loc == ""
+ default = "https://"
help = "https://wiki.mozilla.org/BMO/UserGuide/BugFields#bug_file_loc"
%]
[% INCLUDE bug_url_link %]
[% CASE constants.FIELD_TYPE_FREETEXT %]
[%# normal input field %]
- <input name="[% name FILTER html %]" id="[% name FILTER html %]" value="[% value FILTER html %]" [% aria_labelledby_html FILTER none +%] [% " required" IF required %]>
+ <input name="[% name FILTER html %]" id="[% name FILTER html %]" value="[% value FILTER html %]"
+ [% IF default %] placeholder="[% default FILTER html %]"[% END %]
+ [%+ aria_labelledby_html FILTER none +%] [% " required" IF required %]>
[% CASE constants.FIELD_TYPE_USER %]
[% IF action && !action.hidden %]
<button class="field-button minor [%= action.class FILTER html IF action.class %]"
<b>URL</b>
</td>
<td valign="top">
- <input type="text" size="80" name="bug_file_loc" value="http://">
+ <input type="text" size="80" name="bug_file_loc" placeholder="https://">
<p>
URL that demonstrates the problem you are seeing (optional).<br>
<b>IMPORTANT</b>: if the problem is with a broken web page, you need
%]
<td colspan="3" class="field_value">
<input name="bug_file_loc" id="bug_file_loc" class="text_input"
- size="40" value="[% bug_file_loc FILTER html %]">
+ size="40" value="[% bug_file_loc FILTER html %]" placeholder="https://">
</td>
</tr>
</tbody>
</span>
[% END %]
<span id="bz_url_input_area">
- [% url_output = INCLUDE input no_td=1 inputname => "bug_file_loc" size => "40" colspan => 2 %]
+ [% url_output = INCLUDE input
+ no_td = 1
+ colspan = 2
+ inputname = "bug_file_loc"
+ size = "40"
+ placeholder = "https://"
+ %]
[% IF NOT bug.check_can_change_field("bug_file_loc", 0, 1)
AND is_safe_url(bug.bug_file_loc) %]
<a href="[% bug.bug_file_loc FILTER html %]"
[% IF bug.check_can_change_field(inputname, 0, 1) %]
<input id="[% inputname %]" name="[% inputname %]" class="text_input"
value="[% val FILTER html %]"[% " size=\"$size\"" IF size %]
+ [% IF placeholder %] placeholder="[% placeholder FILTER html %]"[% END %]
[% " maxlength=\"$maxlength\"" IF maxlength %]
[% " spellcheck=\"$spellcheck\"" IF spellcheck %]>
[% ELSE %]