root

Changeset 729

Show
Ignore:
Timestamp:
11/04/09 00:24:38 (4 months ago)
Author:
wbond
Message:

Fixed ticket #339 - some conditional comments were causing the regex in fHTML::prepare() to break

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • fHTML.php

    r588 r729 Hide Line Numbers
    1313 * @link       http://flourishlib.com/fHTML 
    1414 *  
    15  * @version    1.0.0b6 
    16  * #changes    1.0.0b6  Updated ::showChecked() to require strict equality if one parameter is `NULL` [wb, 2009-06-02] 
     15 * @version    1.0.0b7 
     16 * @changes    1.0.0b7  Fixed a bug where some conditional comments were causing the regex in ::prepare() to break [wb, 2009-11-04] 
     17 * @changes    1.0.0b6  Updated ::showChecked() to require strict equality if one parameter is `NULL` [wb, 2009-06-02] 
    1718 * @changes    1.0.0b5  Fixed ::prepare() so it does not encode multi-line HTML comments [wb, 2009-05-09] 
    1819 * @changes    1.0.0b4  Added methods ::printOption() and ::showChecked() that were in fCRUD [wb, 2009-05-08] 
     
    9697    { 
    9798        // Find all a tags with contents, individual HTML tags and HTML comments 
    98         $reg_exp = "/<\s*a(?:\s+[\w:]+(?:\s*=\s*(?:\"[^\"]*?\"|'[^']*?'|[^'\">\s]+))?)*\s*>.*?<\s*\/\s*a\s*>|<\s*\/?\s*[\w:]+(?:\s+[\w:]+(?:\s*=\s*(?:\"[^\"]*?\"|'[^']*?'|[^'\">\s]+))?)*\s*\/?\s*>|<\!--.*?-->/"; 
     99        $reg_exp = "/<\s*a(?:\s+[\w:]+(?:\s*=\s*(?:\"[^\"]*?\"|'[^']*?'|[^'\">\s]+))?)*\s*>.*?<\s*\/\s*a\s*>|<\s*\/?\s*[\w:]+(?:\s+[\w:]+(?:\s*=\s*(?:\"[^\"]*?\"|'[^']*?'|[^'\">\s]+))?)*\s*\/?\s*>|<\!--.*?-->/s"; 
    99100        preg_match_all($reg_exp, $content, $html_matches, PREG_SET_ORDER); 
    100101         
     
    166167    { 
    167168        // Find all html tags, entities and comments 
    168         $reg_exp = "/<\s*\/?\s*[\w:]+(?:\s+[\w:]+(?:\s*=\s*(?:\"[^\"]*?\"|'[^']*?'|[^'\">\s]+))?)*\s*\/?\s*>|&(?:#\d+|\w+);|<\!--(.|\n)*?-->/"; 
     169        $reg_exp = "/<\s*\/?\s*[\w:]+(?:\s+[\w:]+(?:\s*=\s*(?:\"[^\"]*?\"|'[^']*?'|[^'\">\s]+))?)*\s*\/?\s*>|&(?:#\d+|\w+);|<\!--.*?-->/s"; 
    169170        preg_match_all($reg_exp, $content, $html_matches, PREG_SET_ORDER); 
    170171