lib/openwfe/expressions/condition.rb in openwferu-0.9.15 vs lib/openwfe/expressions/condition.rb in openwferu-0.9.16

- old
+ new

@@ -116,11 +116,11 @@ return nil \ unless conditional ldebug { "do_eval_condition() 0 for '#{conditional}'" } - conditional = from_xml conditional + conditional = unescape conditional ldebug { "do_eval_condition() 1 for '#{conditional}'" } begin return to_boolean(do_eval(conditional, workitem)) @@ -144,15 +144,15 @@ def to_boolean (result) ldebug { "to_boolean() result is '#{result}'" } (result == "true" or result == true) end - def from_xml (string) + # + # unescapes '>' and '<' + # + def unescape (s) - s = string - s.gsub!("&gt;", ">") - s.gsub!("&lt;", "<") - s + s.gsub("&amp;", "&").gsub("&gt;", ">").gsub("&lt;", "<") end # # Quotes the given string so that it can easily get evaluated # as Ruby code (a string comparison actually).