Skip to content

Commit 7094f04

Browse files
committed
Only load what is required from cgi
In Ruby 3.5 most of the `cgi` gem will be removed. Only the various escape/unescape methods will be retained by default. On older versions, `require "cgi/util"` is needed because the unescape* methods don't work otherwise. https://bugs.ruby-lang.org/issues/21258
1 parent 8599060 commit 7094f04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/loofah/html5/scrub.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

3-
require "cgi"
3+
require "cgi/escape"
4+
require "cgi/util" if RUBY_VERSION < "3.5"
45
require "crass"
56

67
module Loofah

0 commit comments

Comments
 (0)