Changeset 6236838 in github


Ignore:
Timestamp:
May 12, 2012 5:30:00 AM (13 months ago)
Author:
Aleksander Machniak <alec@…>
Branches:
release-0.8
Children:
02cf44e
Parents:
8253e7d
git-author:
Aleksander Machniak <alec@…> (05/12/12 05:27:59)
git-committer:
Aleksander Machniak <alec@…> (05/12/12 05:30:00)
Message:

Fix handling of some HTML tags e.g. IMG (#1488471) - reworked fix for #1486812

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r71ced07 r6236838  
    22=========================== 
    33 
     4- Fix handling of some HTML tags e.g. IMG (#1488471) 
    45- Use similar language as a fallback for plugin localization (#1488401) 
    56- Fix issue where signature wasn't re-added on draft compose (#1488322) 
  • program/lib/washtml.php

    rf38dfc29 r6236838  
    109109  /* Block elements which could be empty but cannot be returned in short form (<tag />) */ 
    110110  static $block_elements = array('div', 'p', 'pre', 'blockquote', 'a', 'font', 'center', 
    111     'table', 'ul', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'dl', 'strong', 'i', 'b', 'u'); 
     111    'table', 'ul', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'dl', 'strong', 'i', 'b', 'u', 'span'); 
    112112 
    113113  /* State for linked objects in HTML */ 
     
    134134 
    135135  /* Constructor */ 
    136   public function __construct($p = array()) { 
     136  public function __construct($p = array()) 
     137  { 
    137138    $this->_html_elements = array_flip((array)$p['html_elements']) + array_flip(self::$html_elements) ; 
    138139    $this->_html_attribs = array_flip((array)$p['html_attribs']) + array_flip(self::$html_attribs); 
     
    150151 
    151152  /* Check CSS style */ 
    152   private function wash_style($style) { 
     153  private function wash_style($style) 
     154  { 
    153155    $s = ''; 
    154156 
     
    192194 
    193195  /* Take a node and return allowed attributes and check values */ 
    194   private function wash_attribs($node) { 
     196  private function wash_attribs($node) 
     197  { 
    195198    $t = ''; 
    196199    $washed; 
     
    232235   * It output only allowed tags with allowed attributes 
    233236   * and allowed inline styles */ 
    234   private function dumpHtml($node) { 
     237  private function dumpHtml($node) 
     238  { 
    235239    if(!$node->hasChildNodes()) 
    236240      return ''; 
     
    249253          $content = $this->dumpHtml($node); 
    250254          $dump .= '<' . $tagName . $this->wash_attribs($node) . 
    251             // create closing tag for block elements, but also for elements 
    252             // with content or with some attributes (eg. style, class) (#1486812) 
    253             ($content != '' || $node->hasAttributes() || isset($this->_block_elements[$tagName]) ? ">$content</$tagName>" : ' />'); 
     255            ($content != '' || isset($this->_block_elements[$tagName]) ? ">$content</$tagName>" : ' />'); 
    254256        } 
    255257        else if (isset($this->_ignore_elements[$tagName])) { 
     
    311313 
    312314} 
    313  
    314 ?> 
Note: See TracChangeset for help on using the changeset viewer.