alecpl
2010-03-05 2d08c50fd78e8ae74f27a2418f7909b18ae2bf42
program/lib/washtml.php
@@ -87,7 +87,7 @@
  static $html_attribs = array('name', 'class', 'title', 'alt', 'width', 'height', 'align', 'nowrap', 'col', 'row', 'id', 'rowspan', 'colspan', 'cellspacing', 'cellpadding', 'valign', 'bgcolor', 'color', 'border', 'bordercolorlight', 'bordercolordark', 'face', 'marginwidth', 'marginheight', 'axis', 'border', 'abbr', 'char', 'charoff', 'clear', 'compact', 'coords', 'vspace', 'hspace', 'cellborder', 'size', 'lang', 'dir');  
  /* Block elements which could be empty but cannot be returned in short form (<tag />) */
  static $block_elements = array('div', 'p', 'pre', 'blockquote');
  static $block_elements = array('div', 'p', 'pre', 'blockquote', 'a', 'font');
  
  /* State for linked objects in HTML */
  public $extlinks = false;
@@ -171,7 +171,7 @@
      $key = strtolower($key);
      $value = $node->getAttribute($key);
      if(isset($this->_html_attribs[$key]) ||
         ($key == 'href' && preg_match('/^(http|https|ftp|mailto):.+/i', $value)))
         ($key == 'href' && preg_match('/^(http:|https:|ftp:|mailto:|#).+/i', $value)))
        $t .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES) . '"';
      else if($key == 'style' && ($style = $this->wash_style($value)))
        $t .= ' style="' . $style . '"';