~proppy/hackit/qa

« back to all changes in this revision

Viewing changes to proxy/parsers/parse_default.php

  • Committer: Johan Euphrosine
  • Date: 2010-04-27 09:17:53 UTC
  • mfrom: (1.1.3 hackit)
  • Revision ID: proppy@aminche.com-20100427091753-s3r816j9dys2dedm
merge vlad

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        //make all srcs absolute
32
32
        $new_document = preg_replace_callback ( '#(?><[A-Z][A-Z0-9]{0,15})(?>\s+[^>\s]+)*?\s*(?>(src|background|data)\s*=(?!\\\\)\s*)(?>([\\\'"])?)((?(2)(?(?<=")[^"]{1,1000}|[^\\\']{1,1000})|[^ >]{1,1000}))(?(2)\\2|)#i', 'absolute_html_href', $new_document );
33
33
        
 
34
        /*
 
35
        $new_document = preg_match_all( '#(?><[A-Z][A-Z0-9]{0,15})(?>\s+[^>\s]+)*?\s*(?>(src|background|data)\s*=(?!\\\\)\s*)(?>([\\\'"])?)((?(2)(?(?<=")[^"]{1,1000}|[^\\\']{1,1000})|[^ >]{1,1000}))(?(2)\\2|)#i', $new_document, $matches );
 
36
        */
 
37
        $a= '#(?>
 
38
                <[A-Z][A-Z0-9]{0,15}
 
39
        )
 
40
        (?>
 
41
                \s+[^>\s]+
 
42
        )*?
 
43
        \s*
 
44
        (?>
 
45
                (src|background|data)
 
46
                \s*
 
47
                =
 
48
                (?!\\\\)\s*
 
49
        )
 
50
        (?>
 
51
                ([\\\'"])?
 
52
        )
 
53
        (
 
54
                (?(2)(?(?<=")[^"]{1,1000}|[^\\\']{1,1000})|[^ >]{1,1000}))(?(2)\\2|)#i';
 
55
        
 
56
        
 
57
        print_r($matches);
34
58
        
35
59
        $document = preg_replace ( $body_pattern, $new_document, $document );
36
60