Changeset 394


Ignore:
Timestamp:
10/22/05 03:53:36 (14 years ago)
Author:
gogo
Message:

Apply #501

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/HtmlTidy/html-tidy-logic.php

    r296 r394  
    1818                1 => array("pipe", "w") 
    1919        ); 
    20         $process = proc_open("tidy -utf8 -config html-tidy-config.cfg", $descriptorspec, $pipes); 
     20        $process = @proc_open("tidy -utf8 -config html-tidy-config.cfg", $descriptorspec, $pipes); 
    2121 
    2222 
     
    4040 
    4141        } else { 
    42                 // Better give them back what they came with, so they don't lose it all... 
    43                 $newsrc = "<body>\n" .$source. "\n</body>"; 
     42    /* Use tidy if it's available from PECL */ 
     43    if( function_exists('tidy_parse_string') ) 
     44    { 
     45      $tempsrc = tidy_parse_string($source); 
     46      tidy_clean_repair(); 
     47      $newsrc = tidy_get_output(); 
     48    } 
     49    else 
     50    { 
     51      // Better give them back what they came with, so they don't lose it all... 
     52      $newsrc = "<body>\n" .$source. "\n</body>"; 
     53    } 
    4454        } 
    4555 
Note: See TracChangeset for help on using the changeset viewer.