Changeset 36c236e in github
- Timestamp:
- Sep 16, 2008 9:02:53 AM (5 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- a47acc5
- Parents:
- 2f746dcd
- Location:
- program
- Files:
-
- 2 edited
-
include/html.php (modified) (1 diff)
-
steps/mail/func.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/html.php
r1518702 r36c236e 34 34 35 35 public static $common_attrib = array('id','class','style','title','align'); 36 public static $containers = array('div','span','p','h1','h2','h3','form','textarea','table','tr','th','td' );36 public static $containers = array('div','span','p','h1','h2','h3','form','textarea','table','tr','th','td','style'); 37 37 public static $lc_tags = true; 38 38 -
program/steps/mail/func.inc
r109314c r36c236e 612 612 } 613 613 614 // allow CSS styles, will be sanitized by rcmail_washtml_callback()615 if ($p['safe']) {616 $wash_opts['html_elements'][] = 'style';617 }618 619 614 $washer = new washtml($wash_opts); 620 615 $washer->add_callback('form', 'rcmail_washtml_callback'); 621 $washer->add_callback('style', 'rcmail_washtml_callback'); 616 617 if ($p['safe']) { // allow CSS styles, will be sanitized by rcmail_washtml_callback() 618 $washer->add_callback('style', 'rcmail_washtml_callback'); 619 } 620 622 621 $body = $washer->wash($html); 623 622 $REMOTE_OBJECTS = $washer->extlinks; … … 709 708 case 'style': 710 709 // decode all escaped entities and reduce to ascii strings 711 $stripped = preg_replace('/[^a-zA-Z\(:]/', '', rcmail_xss_entitiy_decode($ source));710 $stripped = preg_replace('/[^a-zA-Z\(:]/', '', rcmail_xss_entitiy_decode($content)); 712 711 713 // now check for ev listrings like expression, behavior or url()714 if (!preg_match('/expression|behavior|url\(|import/', $ css)) {712 // now check for evil strings like expression, behavior or url() 713 if (!preg_match('/expression|behavior|url\(|import/', $stripped)) { 715 714 $out = html::tag('style', array('type' => 'text/css'), $content); 716 715 break;
Note: See TracChangeset
for help on using the changeset viewer.
