Changeset 2617 in subversion
- Timestamp:
- Jun 5, 2009 2:03:21 PM (4 years ago)
- Location:
- trunk/roundcubemail/program
- Files:
-
- 2 edited
-
include/main.inc (modified) (5 diffs)
-
steps/mail/func.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/main.inc
r2609 r2617 129 129 function rcmail_temp_gc() 130 130 { 131 $tmp = unslashify($CONFIG['temp_dir']); 131 $rcmail = rcmail::get_instance(); 132 133 $tmp = unslashify($rcmail->config->get('temp_dir')); 132 134 $expire = mktime() - 172800; // expire in 48 hours 133 135 … … 565 567 $value = $_COOKIE[$fname]; 566 568 } 567 569 570 if (empty($value)) 571 return $value; 572 568 573 // strip single quotes if magic_quotes_sybase is enabled 569 574 if (ini_get('magic_quotes_sybase')) … … 724 729 725 730 // ignore the whole block if evil styles are detected 726 $stripped = preg_replace('/[^a-z\(:]/', '', rcmail_xss_entit iy_decode($source));731 $stripped = preg_replace('/[^a-z\(:]/', '', rcmail_xss_entity_decode($source)); 727 732 if (preg_match('/expression|behavior|url\(|import/', $stripped)) 728 733 return '/* evil! */'; … … 765 770 * @return string Decoded string 766 771 */ 767 function rcmail_xss_entit iy_decode($content)772 function rcmail_xss_entity_decode($content) 768 773 { 769 774 $out = html_entity_decode(html_entity_decode($content)); 770 $out = preg_replace_callback('/\\\([0-9a-f]{4})/i', 'rcmail_xss_entit iy_decode_callback', $out);775 $out = preg_replace_callback('/\\\([0-9a-f]{4})/i', 'rcmail_xss_entity_decode_callback', $out); 771 776 $out = preg_replace('#/\*.*\*/#Um', '', $out); 772 777 return $out; … … 775 780 776 781 /** 777 * preg_replace_callback callback for rcmail_xss_entit iy_decode_callback782 * preg_replace_callback callback for rcmail_xss_entity_decode_callback 778 783 * 779 784 * @param array matches result from preg_replace_callback 780 785 * @return string decoded entity 781 786 */ 782 function rcmail_xss_entit iy_decode_callback($matches)787 function rcmail_xss_entity_decode_callback($matches) 783 788 { 784 789 return chr(hexdec($matches[1])); -
trunk/roundcubemail/program/steps/mail/func.inc
r2616 r2617 862 862 case 'style': 863 863 // decode all escaped entities and reduce to ascii strings 864 $stripped = preg_replace('/[^a-zA-Z\(:]/', '', rcmail_xss_entit iy_decode($content));864 $stripped = preg_replace('/[^a-zA-Z\(:]/', '', rcmail_xss_entity_decode($content)); 865 865 866 866 // now check for evil strings like expression, behavior or url()
Note: See TracChangeset
for help on using the changeset viewer.
