summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/axlsx.rb b/lib/axlsx.rb
index c5d26c2b..586562f6 100644
--- a/lib/axlsx.rb
+++ b/lib/axlsx.rb
@@ -136,10 +136,14 @@ module Axlsx
# @param [String] str The string to process
# @return [String]
def self.sanitize(str)
- str.delete!(CONTROL_CHARS)
- str
+ if str.frozen?
+ str.delete(CONTROL_CHARS)
+ else
+ str.delete!(CONTROL_CHARS)
+ str
+ end
end
-
+
# If value is boolean return 1 or 0
# else return the value
# @param [Object] value The value to process