whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Trim trailing >; only trim if <> enclose the name
Date Sun, 21 Oct 2018 14:41:04 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 51cc04d  Trim trailing >; only trim if <> enclose the name
51cc04d is described below

commit 51cc04dbc2ac85072d2f78b0f90faa68398d0173
Author: Sebb <sebb@apache.org>
AuthorDate: Sun Oct 21 15:40:25 2018 +0100

    Trim trailing >; only trim if <> enclose the name
---
 www/secretary/workbench/models/message.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/secretary/workbench/models/message.rb b/www/secretary/workbench/models/message.rb
index d61fcb2..cf94995 100644
--- a/www/secretary/workbench/models/message.rb
+++ b/www/secretary/workbench/models/message.rb
@@ -27,7 +27,7 @@ class Message
   # find an attachment
   #
   def find(name)
-    name = name[1...-1] if name =~ /<.*>/
+    name = name[1...-2] if name =~ /^<.*>$/ # drop enclosing <> if present
     name = name[2..-1] if name.start_with? './'
     name = name.dup.force_encoding('utf-8')
 


Mime
View raw message