Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jbr/441238 to your computer and use it in GitHub Desktop.
Save jbr/441238 to your computer and use it in GitHub Desktop.
From b3927509174147bc7fc042e6b900be877c226a41 Mon Sep 17 00:00:00 2001
From: Jacob Rothstein <[email protected]>
Date: Wed, 16 Jun 2010 13:40:27 -0700
Subject: [PATCH] splat out ESCAPE_HTML.keys for older rubies
---
lib/rack/utils.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb
index 45c1517..bc60cd1 100644
--- a/lib/rack/utils.rb
+++ b/lib/rack/utils.rb
@@ -135,7 +135,7 @@ module Rack
"'" => "&#39;",
'"' => "&quot;",
}
- ESCAPE_HTML_PATTERN = Regexp.union(ESCAPE_HTML.keys)
+ ESCAPE_HTML_PATTERN = Regexp.union(*ESCAPE_HTML.keys)
# Escape ampersands, brackets and quotes to their HTML/XML entities.
def escape_html(string)
--
1.7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment