Don't send the referer when hotlinking preview images on the /uploads/new page. Improves user privacy and may bypass anti-hotlinking protections in some cases.
24 lines
861 B
Plaintext
24 lines
861 B
Plaintext
<% if params[:url] %>
|
|
<div id="upload-image">
|
|
<% if ImageProxy.needs_proxy?(@source.image_url) %>
|
|
<%= tag.img src: image_proxy_uploads_path(url: @source.image_url), title: "Preview", id: "image" %>
|
|
<% elsif @source.image_url.present? %>
|
|
<%= tag.img src: @source.image_url, title: "Preview", id: "image", referrerpolicy: "no-referrer" %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<ul id="upload-image-metadata">
|
|
<li id="no-image-available"><em>No image preview available</em></li>
|
|
|
|
<% if @remote_size %>
|
|
<li><strong>Size:</strong> <%= number_to_human_size(@remote_size) %></li>
|
|
<% end %>
|
|
|
|
<% if params[:ref] %>
|
|
<li><strong>Referrer:</strong> <%= params[:ref] %></li>
|
|
<% end %>
|
|
|
|
<li id="scale-link"><span id="scale"></span> (<%= link_to "toggle size", "#", :id => "image-resize-to-window-link" %>)</li>
|
|
</ul>
|
|
<% end %>
|