• Download Gist
added-dup-to-result-returned-by-lookup-key-to-avoid-modification-of-translation-keys.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
From 0f78adcd6572fc2619c8809c52e82a284d339372 Mon Sep 17 00:00:00 2001
From: Erik Andrejko <erik@shopittome.com>
Date: Tue, 2 Feb 2010 14:40:45 -0800
Subject: [PATCH] added dup to result returned by lookup_key to avoid modification of translation keys
 
---
lib/i18n/backend/base.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
 
diff --git a/lib/i18n/backend/base.rb b/lib/i18n/backend/base.rb
index 7b2e876..156c94b 100644
--- a/lib/i18n/backend/base.rb
+++ b/lib/i18n/backend/base.rb
@@ -117,7 +117,7 @@ module I18n
return nil unless result.is_a?(Hash) && result.has_key?(key)
result = result[key]
result = resolve(locale, key, result, options) if result.is_a?(Symbol)
- result
+ result.dup
end
end
--
1.6.2.2+GitX

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.