Skip to content

Commit

Permalink
Handle empty #{} in Haml templates
Browse files Browse the repository at this point in the history
fixes #732
  • Loading branch information
presidentbeef committed Oct 24, 2015
1 parent 148255a commit 558e8dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/brakeman/processors/haml_template_processor.rb
Expand Up @@ -141,7 +141,7 @@ def build_output_from_push_text exp, default = :output
if string_interp? exp
exp.map! do |e|
if sexp? e
if node_type? e, :evstr
if node_type? e, :evstr and e[1]
e = e.value
end

Expand Down
3 changes: 3 additions & 0 deletions test/apps/rails4/app/controllers/users_controller.rb
Expand Up @@ -103,4 +103,7 @@ def hash_some_things
OpenSSL::Digest.new("SHA1")
OpenSSL::Digest::MD5.digest(password)
end

def more_haml
end
end
10 changes: 10 additions & 0 deletions test/apps/rails4/app/views/users/more_haml.html.haml
@@ -0,0 +1,10 @@
%body
:javascript
$(function() {
#{
# Ticket #9999
# my variable needs to be number 4
}
var myVar = 4;
});

0 comments on commit 558e8dd

Please sign in to comment.