security updates
have to check views and entityreference for custom patches
This commit is contained in:
@@ -81,31 +81,11 @@ function template_preprocess_mimemail_message(&$variables) {
|
||||
if (isset($styles)) {
|
||||
// Process each style sheet.
|
||||
foreach (explode("\n", $styles) as $style) {
|
||||
if (!empty($style) && @file_exists($style)) {
|
||||
$css .= @file_get_contents($style);
|
||||
if (!empty($style)) {
|
||||
$css .= drupal_load_stylesheet($style, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
// Regexp to match comment blocks.
|
||||
$comment = '/\*[^*]*\*+(?:[^/*][^*]*\*+)*/';
|
||||
// Regexp to match double quoted strings.
|
||||
$double_quot = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"';
|
||||
// Regexp to match single quoted strings.
|
||||
$single_quot = "'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'";
|
||||
|
||||
// Perform some safe CSS optimizations (derived from core CSS aggregation).
|
||||
$css = preg_replace_callback(
|
||||
"<$double_quot|$single_quot|$comment>Sus", // Match all comment blocks along
|
||||
"_mimemail_process_comment", // with double/single quoted strings
|
||||
$css); // and feed them to _mimemail_process_comment().
|
||||
$css = preg_replace(
|
||||
'<\s*([@{}:;,]|\)\s|\s\()\s*[^\n\S]>S', // Remove whitespace around separators,
|
||||
'\1', // but keep space around parentheses
|
||||
$css); // and new lines between definitions.
|
||||
|
||||
// End the file with a new line.
|
||||
$css .= "\n";
|
||||
|
||||
// Wordwrap to adhere to RFC821
|
||||
$css = wordwrap($css, 700);
|
||||
}
|
||||
@@ -120,35 +100,3 @@ function template_preprocess_mimemail_message(&$variables) {
|
||||
$variables['module'] = str_replace('_', '-', $variables['module']);
|
||||
$variables['key'] = str_replace('_', '-', $variables['key']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process comment blocks. (derived from core CSS aggregation)
|
||||
*
|
||||
* This is the callback function for the preg_replace_callback()
|
||||
* used in drupal_load_stylesheet_content(). Support for comment
|
||||
* hacks is implemented here.
|
||||
*/
|
||||
function _mimemail_process_comment($matches) {
|
||||
static $keep_nextone = FALSE;
|
||||
// Quoted string, keep it.
|
||||
if ($matches[0][0] == "'" || $matches[0][0] == '"') {
|
||||
return $matches[0];
|
||||
}
|
||||
// End of IE-Mac hack, keep it.
|
||||
if ($keep_nextone) {
|
||||
$keep_nextone = FALSE;
|
||||
return $matches[0];
|
||||
}
|
||||
switch (strrpos($matches[0], '\\')) {
|
||||
case FALSE :
|
||||
// No backslash, strip it.
|
||||
return '';
|
||||
case drupal_strlen($matches[0])-3 :
|
||||
// Ends with \*/ so is a multi line IE-Mac hack, keep the next one also.
|
||||
$keep_nextone = TRUE;
|
||||
return '/*_\*/';
|
||||
default :
|
||||
// Single line IE-Mac hack.
|
||||
return '/*\_*/';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user