From b2f662c1d53ccd1ebe9ad263e7994cc80675b73f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tautvidas=20Sipavi=C4=8Dius?= Date: Mon, 5 Dec 2016 19:45:46 +0200 Subject: [PATCH] Fix displaying dividers in ALC blocks MAILPOET-721 --- lib/Newsletter/Editor/PostListTransformer.php | 2 +- lib/Newsletter/Editor/PostTransformer.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Newsletter/Editor/PostListTransformer.php b/lib/Newsletter/Editor/PostListTransformer.php index c52e54be77..d6d50fada8 100644 --- a/lib/Newsletter/Editor/PostListTransformer.php +++ b/lib/Newsletter/Editor/PostListTransformer.php @@ -14,7 +14,7 @@ class PostListTransformer { function transform($posts) { $results = array(); - $use_divider = $this->args['showDivider'] === 'true'; + $use_divider = filter_var($this->args['showDivider'], FILTER_VALIDATE_BOOLEAN); foreach($posts as $index => $post) { if($use_divider && $index > 0) { diff --git a/lib/Newsletter/Editor/PostTransformer.php b/lib/Newsletter/Editor/PostTransformer.php index 138b466dba..bd2ab4ee8d 100644 --- a/lib/Newsletter/Editor/PostTransformer.php +++ b/lib/Newsletter/Editor/PostTransformer.php @@ -29,7 +29,7 @@ class PostTransformer { $structure = $this->appendFeaturedImage( $post, $this->args['displayType'], - $this->args['imageFullWidth'] === 'true', + filter_var($this->args['imageFullWidth'], FILTER_VALIDATE_BOOLEAN), $structure ); } else { @@ -37,7 +37,7 @@ class PostTransformer { $structure = $this->appendFeaturedImage( $post, $this->args['displayType'], - $this->args['imageFullWidth'] === 'true', + filter_var($this->args['imageFullWidth'], FILTER_VALIDATE_BOOLEAN), $structure ); } @@ -155,7 +155,7 @@ class PostTransformer { private function getPostTitle($post) { $title = $post->post_title; - if($this->args['titleIsLink'] === 'true') { + if(filter_var($this->args['titleIsLink'], FILTER_VALIDATE_BOOLEAN)) { $title = '' . $title . ''; }