safe_email_name 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/safe_email_name.rb +2 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e2cad3fb69aa0faa761be3e2bb610fd51cf1b68
|
4
|
+
data.tar.gz: 5668c8ba25a1880e1908c2db4b722f61ab674cfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f7f1e2d4bd457cb943e352a2af11c434062ea68f94d73de4d36742f9f130103c80a02b057a0456b022007dd13ee5762511387c180e4b525963587921b5ec4a1
|
7
|
+
data.tar.gz: 8e7b7fd88ec816bca11f1387c6fc67f9b38c00f807f9279ac3328d5472cbda071b5682b1570cd728e7fcadb5aae1eec1b1e4d93267852d2a4aafb9bbbc63e289
|
data/lib/safe_email_name.rb
CHANGED
@@ -5,8 +5,9 @@ require 'active_support/core_ext/string/filters' # squish
|
|
5
5
|
module SafeEmailName
|
6
6
|
def safe_email_name(name, email)
|
7
7
|
escaped_chars = /["<>]/
|
8
|
+
|
8
9
|
email = email.gsub(escaped_chars, '')
|
9
|
-
name = name.gsub(escaped_chars, '').squish
|
10
|
+
name = (name || "").gsub(escaped_chars, '').squish
|
10
11
|
if name.blank?
|
11
12
|
email
|
12
13
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: safe_email_name
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sunny Ripert
|
@@ -14,28 +14,28 @@ dependencies:
|
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: Escape the name in To and From fields in emails
|