Changeset 65c3bb0 in github
- Timestamp:
- Jun 13, 2012 9:07:46 AM (11 months ago)
- Branches:
- release-0.8
- Children:
- d5d3c70
- Parents:
- 21be272
- Files:
-
- 2 edited
-
CHANGELOG (modified) (1 diff)
-
program/lib/washtml.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r21be272 r65c3bb0 2 2 =========================== 3 3 4 - Fix handling of unitless CSS size values in HTML message (#1488535) 4 5 - Fix removing contact photo using LDAP addressbook (#1488420) 5 6 - Fix storing X-ANNIVERSARY date in vCard format (#1488527) -
program/lib/washtml.php
r51809bd r65c3bb0 77 77 * - base URL support 78 78 * - invalid HTML comments removal before parsing 79 * - "fixing" unitless CSS values for XHTML output 79 80 */ 80 81 … … 158 159 if (preg_match('/^\s*([a-z\-]+)\s*:\s*(.*)\s*$/i', $declaration, $match)) { 159 160 $cssid = $match[1]; 160 $str = $match[2];161 $str = $match[2]; 161 162 $value = ''; 163 162 164 while (sizeof($str) > 0 && 163 165 preg_match('/^(url\(\s*[\'"]?([^\'"\)]*)[\'"]?\s*\)'./*1,2*/ 164 166 '|rgb\(\s*[0-9]+\s*,\s*[0-9]+\s*,\s*[0-9]+\s*\)'. 165 167 '|-?[0-9.]+\s*(em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)?'. 166 '|#[0-9a-f]{3,6}|[a-z0-9", -]+'. 167 ')\s*/i', $str, $match)) { 168 '|#[0-9a-f]{3,6}'. 169 '|[a-z0-9", -]+'. 170 ')\s*/i', $str, $match) 171 ) { 168 172 if ($match[2]) { 169 173 if (($src = $this->config['cid_map'][$match[2]]) … … 181 185 } 182 186 } 183 else if ($match[0] != 'url' && $match[0] != 'rgb')//whitelist ?187 else { //whitelist ? 184 188 $value .= ' ' . $match[0]; 185 189 190 // #1488535: Fix size units, so width:800 would be changed to width:800px 191 if (preg_match('/(left|right|top|bottom|width|height)/i', $cssid) && preg_match('/^[0-9]+$/', $match[0])) { 192 $value .= 'px'; 193 } 194 } 195 186 196 $str = substr($str, strlen($match[0])); 187 197 } 188 if ($value) 198 199 if (isset($value[0])) { 189 200 $s .= ($s?' ':'') . $cssid . ':' . $value . ';'; 201 } 190 202 } 191 203 }
Note: See TracChangeset
for help on using the changeset viewer.
