https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292015-07-18T06:13:44ZRedmineRedmine - Defect #20278: Wrong syntax for resizing inline images will throw a 500 errorhttps://www.redmine.org/issues/20278?journal_id=649182015-07-18T06:13:44ZGo MAEDA
<ul></ul><p>Although this is not a solution to the root of the error, we can avoid the error and save some cycles.<br />(String#casecmp is much faster than calling String#downcase twice)</p>
<pre><code class="diff syntaxhl"><span class="gh">Index: app/models/attachment.rb
===================================================================
</span><span class="gd">--- app/models/attachment.rb (revision 14445)
</span><span class="gi">+++ app/models/attachment.rb (working copy)
</span><span class="p">@@ -294,7 +294,7 @@</span>
def self.latest_attach(attachments, filename)
attachments.sort_by(&:created_on).reverse.detect do |att|
<span class="gd">- att.filename.downcase == filename.downcase
</span><span class="gi">+ filename.casecmp(att.filename)
</span> end
end
</code></pre> Redmine - Defect #20278: Wrong syntax for resizing inline images will throw a 500 errorhttps://www.redmine.org/issues/20278?journal_id=649232015-07-19T05:42:02ZGo MAEDA
<ul></ul><p>Sorry, workaround on <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Wrong syntax for resizing inline images will throw a 500 error (Closed)" href="https://www.redmine.org/issues/20278#note-1">#20278#note-1</a> is wrong.</p>
<p>Should be replaced with the following:</p>
<pre><code class="diff syntaxhl"><span class="gh">Index: app/models/attachment.rb
===================================================================
</span><span class="gd">--- app/models/attachment.rb (revision 14445)
</span><span class="gi">+++ app/models/attachment.rb (working copy)
</span><span class="p">@@ -294,7 +294,7 @@</span>
def self.latest_attach(attachments, filename)
attachments.sort_by(&:created_on).reverse.detect do |att|
<span class="gd">- att.filename.downcase == filename.downcase
</span><span class="gi">+ filename.casecmp(att.filename) == 0
</span> end
end
</code></pre> Redmine - Defect #20278: Wrong syntax for resizing inline images will throw a 500 errorhttps://www.redmine.org/issues/20278?journal_id=649252015-07-19T07:45:28ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-5 priority-4 priority-default closed" href="/issues/20369">Patch #20369</a>: Use String#casecmp for case insensitive comparison</i> added</li></ul> Redmine - Defect #20278: Wrong syntax for resizing inline images will throw a 500 errorhttps://www.redmine.org/issues/20278?journal_id=652522015-08-02T07:25:49ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Category</strong> set to <i>Text formatting</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Target version</strong> set to <i>3.1.1</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Fix committed with a test in <a class="changeset" title="Wrong syntax for resizing inline images may throw a 500 error (#20278). Fix by Go MAEDA." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/14473">r14473</a>, thanks.</p> Redmine - Defect #20278: Wrong syntax for resizing inline images will throw a 500 errorhttps://www.redmine.org/issues/20278?journal_id=659762015-09-12T10:51:44ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p>Merged.</p>