Changeset 243

Show
Ignore:
Timestamp:
02/28/08 11:37:09 (6 months ago)
Author:
stu
Message:

turn off parts of xss_shield that are blowing up Fizmo

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • rubygems/tarantula/trunk/vendor/xss-shield/lib/xss_shield.rb

    r240 r243  
    22# Tarantula doesn't use haml 
    33# require 'xss_shield/haml_hacks' 
    4 require 'xss_shield/erb_hacks' 
     4# ERB hacks blow up Rails 
     5# require 'xss_shield/erb_hacks' 
    56require 'xss_shield/secure_helpers' 
  • rubygems/tarantula/trunk/vendor/xss-shield/lib/xss_shield/erb_hacks.rb

    r240 r243  
    77      scanner = make_scanner(s) 
    88      scanner.scan do |token| 
    9        if scanner.stag.nil? 
    10          case token 
     9  if scanner.stag.nil? 
     10    case token 
    1111          when PercentLine 
    12            out.push("#{@put_cmd} #{content.dump}") if content.size > 0 
    13            content = '' 
     12      out.push("#{@put_cmd} #{content.dump}") if content.size > 0 
     13      content = '' 
    1414            out.push(token.to_s) 
    1515            out.cr 
    16          when :cr 
    17            out.cr 
    18          when '<%', '<%=', '<%#' 
    19            scanner.stag = token 
    20            out.push("#{@put_cmd} #{content.dump}") if content.size > 0 
    21            content = '' 
    22          when "\n" 
    23            content << "\n" 
    24            out.push("#{@put_cmd} #{content.dump}") 
    25            out.cr 
    26            content = '' 
    27          when '<%%' 
    28            content << '<%' 
    29          else 
    30            content << token 
    31          end 
    32        else 
    33          case token 
    34          when '%>' 
    35            case scanner.stag 
    36            when '<%' 
    37              if content[-1] == ?\n 
    38                content.chop! 
    39                out.push(content) 
    40                out.cr 
    41              else 
    42                out.push(content) 
    43              end 
    44            when '<%=' 
     16    when :cr 
     17      out.cr 
     18    when '<%', '<%=', '<%#' 
     19      scanner.stag = token 
     20      out.push("#{@put_cmd} #{content.dump}") if content.size > 0 
     21      content = '' 
     22    when "\n" 
     23      content << "\n" 
     24      out.push("#{@put_cmd} #{content.dump}") 
     25      out.cr 
     26      content = '' 
     27    when '<%%' 
     28      content << '<%' 
     29    else 
     30      content << token 
     31    end 
     32  else 
     33    case token 
     34    when '%>' 
     35      case scanner.stag 
     36      when '<%' 
     37        if content[-1] == ?\n 
     38    content.chop! 
     39    out.push(content) 
     40    out.cr 
     41        else 
     42    out.push(content) 
     43        end 
     44      when '<%=' 
    4545              # NOTE: Changed lines 
    46              out.push("#{@insert_cmd}((#{content}).to_s_xss_protected)") 
     46        out.push("#{@insert_cmd}((#{content}).to_s_xss_protected)") 
    4747              # NOTE: End changed lines 
    48            when '<%#' 
    49              # out.push("# #{content.dump}") 
    50            end 
    51            scanner.stag = nil 
    52            content = '' 
    53          when '%%>' 
    54            content << '%>' 
    55          else 
    56            content << token 
    57          end 
    58        end 
     48      when '<%#' 
     49        # out.push("# #{content.dump}") 
     50      end 
     51      scanner.stag = nil 
     52      content = '' 
     53    when '%%>' 
     54      content << '%>' 
     55    else 
     56      content << token 
     57    end 
     58  end 
    5959      end 
    6060      out.push("#{@put_cmd} #{content.dump}") if content.size > 0