From 651cd3fea0035a14dbacf7b63607fbcbb0646984 Mon Sep 17 00:00:00 2001 From: Erick Hitter <ehitter@gmail.com> Date: Tue, 25 Feb 2014 21:38:38 -0800 Subject: [PATCH] Remove spurious whitespace from cached values to reduce validation errors and condense output buffer interaction for simpler code. --- index-wp-redis.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index-wp-redis.php b/index-wp-redis.php index 4b3966e..cda1480 100644 --- a/index-wp-redis.php +++ b/index-wp-redis.php @@ -93,7 +93,7 @@ try { $cache = true; - $html_of_page = $redis->get( $redis_key ); + $html_of_page = trim( $redis->get( $redis_key ) ); echo $html_of_page; // If the cache does not exist lets display the user the normal page without cache, and then fetch a new cache page @@ -108,8 +108,7 @@ try { if ( ! $is_post && ! $logged_in ) { ob_start(); require './wp-blog-header.php'; - $html_of_page = ob_get_contents(); - ob_end_clean(); + $html_of_page = trim( ob_get_clean() ); echo $html_of_page; if ( ! is_numeric( $seconds_cache_redis ) ) { -- GitLab