Skip to content

Commit

Permalink
Fix Sprockets::Base#unescape to avoid unexpected change landed in 3…
Browse files Browse the repository at this point in the history
….7.4.

384bf45 breaks `Sprockets::Base#unescape`.

The following code has been changed between 3.7.3 and 3.7.4.
``` console
$ ruby -I ./lib -r sprockets -e 'p [Sprockets::VERSION, Sprockets::Environment.new.send(:unescape, "%")]'
```

```
["3.7.3", "%"]
["3.7.4", "%25"]
```

This commit changes back to the behavior of 3.7.3.
  • Loading branch information
tricknotes committed Sep 10, 2024
1 parent fb92f7b commit 86ea3e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sprockets/legacy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def matches_filter(filters, logical_path, filename)
end

def unescape(str)
URIUtils::URI_PARSER.unescape(str)
str = URIUtils::URI_PARSER.unescape(str)
str.force_encoding(Encoding.default_internal) if Encoding.default_internal
str
end
Expand Down

0 comments on commit 86ea3e2

Please sign in to comment.