Aleksander Machniak
2014-03-22 fbe5bc9ba2ad4960994885e84a118d0aaff4431f
CS fixes
1 files modified
15 ■■■■■ changed files
program/steps/utils/modcss.inc 15 ●●●●● patch | view | raw | blame | history
program/steps/utils/modcss.inc
@@ -5,7 +5,7 @@
 | program/steps/utils/modcss.inc                                        |
 |                                                                       |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2007-2012, The Roundcube Dev Team                       |
 | Copyright (C) 2007-2014, The Roundcube Dev Team                       |
 |                                                                       |
 | Licensed under the GNU General Public License version 3 or            |
 | any later version with exceptions for skins & plugins.                |
@@ -47,7 +47,8 @@
    // php.net/manual/en/reserved.variables.httpresponseheader.php
    $headers = implode("\n", (array)$http_response_header);
} else if (function_exists('curl_init')) {
}
else if (function_exists('curl_init')) {
    $curl = curl_init($realurl);
    curl_setopt($curl, CURLOPT_TIMEOUT, 15);
    curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 15);
@@ -59,18 +60,20 @@
    if ($data !== false) {
        list($headers, $source) = explode("\r\n\r\n", $data, 2);
    } else {
    }
    else {
        $headers = false;
        $source = false;
    }
} else {
}
else {
    header('HTTP/1.1 403 Forbidden');
    exit("HTTP connections disabled");
}
$ctype   = '~Content-Type:\s+text/(css|plain)~i';
$ctype_regexp = '~Content-Type:\s+text/(css|plain)~i';
if ($source !== false && preg_match($ctype, $headers)) {
if ($source !== false && preg_match($ctype_regexp, $headers)) {
    header('Content-Type: text/css');
    echo rcube_utils::mod_css_styles($source, preg_replace('/[^a-z0-9]/i', '', $_GET['_c']));
    exit;