Commit 079cac33 authored by Dries's avatar Dries

- Patch #428242 by David_Rothstein: small code clean-up in check_markup().

parent dd3e3989
...@@ -435,9 +435,6 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $langcode = '', $c ...@@ -435,9 +435,6 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $langcode = '', $c
return $cached->data; return $cached->data;
} }
// See if caching is allowed for this format.
$cache = filter_format_allowcache($format);
// Convert all Windows and Mac newlines to a single newline, // Convert all Windows and Mac newlines to a single newline,
// so filters only need to deal with one possibility. // so filters only need to deal with one possibility.
$text = str_replace(array("\r\n", "\r"), "\n", $text); $text = str_replace(array("\r\n", "\r"), "\n", $text);
...@@ -456,7 +453,7 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $langcode = '', $c ...@@ -456,7 +453,7 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $langcode = '', $c
} }
// Store in cache with a minimum expiration time of 1 day. // Store in cache with a minimum expiration time of 1 day.
if ($cache) { if (filter_format_allowcache($format)) {
cache_set($cache_id, $text, 'cache_filter', REQUEST_TIME + (60 * 60 * 24)); cache_set($cache_id, $text, 'cache_filter', REQUEST_TIME + (60 * 60 * 24));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment