Changeset 4488 in subversion
- Timestamp:
- Feb 3, 2011 4:12:35 PM (2 years ago)
- Location:
- trunk/roundcubemail/program/steps
- Files:
-
- 2 edited
-
mail/func.inc (modified) (2 diffs)
-
utils/modcss.inc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/func.inc
r4484 r4488 1195 1195 function rcmail_alter_html_link($matches) 1196 1196 { 1197 global $ EMAIL_ADDRESS_PATTERN;1197 global $RCMAIL, $EMAIL_ADDRESS_PATTERN; 1198 1198 1199 1199 $tag = $matches[1]; … … 1202 1202 1203 1203 if ($tag == 'link' && preg_match('/^https?:\/\//i', $attrib['href'])) { 1204 $attrib['href'] = "?_task=utils&_action=modcss&u=" . urlencode($attrib['href']) 1205 . "&c=" . urlencode($GLOBALS['rcmail_html_container_id']); 1204 $tempurl = 'tmp-' . md5($attrib['href']) . '.css'; 1205 $_SESSION['modcssurls'][$tempurl] = $attrib['href']; 1206 $attrib['href'] = $RCMAIL->url(array('task' => 'utils', 'action' => 'modcss', 'u' => $tempurl, 'c' => $GLOBALS['rcmail_html_container_id'])); 1206 1207 $end = ' />'; 1207 1208 } -
trunk/roundcubemail/program/steps/utils/modcss.inc
r4410 r4488 6 6 | | 7 7 | This file is part of the Roundcube Webmail client | 8 | Copyright (C) 2007-201 0, The Roundcube Dev Team |8 | Copyright (C) 2007-2011, The Roundcube Dev Team | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 22 22 $source = ''; 23 23 24 $url = preg_replace('![^a-z0-9 :./\-_?$&=%]!i', '', $_GET['u']);25 if ($url === null ) {24 $url = preg_replace('![^a-z0-9.-]!i', '', $_GET['_u']); 25 if ($url === null || !($realurl = $_SESSION['modcssurls'][$url])) { 26 26 header('HTTP/1.1 403 Forbidden'); 27 echo $error;27 echo "Unauthorized request"; 28 28 exit; 29 29 } 30 30 31 $a_uri = parse_url($ url);31 $a_uri = parse_url($realurl); 32 32 $port = $a_uri['port'] ? $a_uri['port'] : 80; 33 33 $host = $a_uri['host']; … … 86 86 if (!empty($source) && in_array($mimetype, array('text/css','text/plain'))) { 87 87 header('Content-Type: text/css'); 88 echo rcmail_mod_css_styles($source, preg_replace('/[^a-z0-9]/i', '', $_GET[' c']));88 echo rcmail_mod_css_styles($source, preg_replace('/[^a-z0-9]/i', '', $_GET['_c'])); 89 89 exit; 90 90 }
Note: See TracChangeset
for help on using the changeset viewer.
