Skip to content

Commit dad9438

Browse files
committed
Updates with code review changes
1 parent 27c8b4e commit dad9438

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

include/lcp-catlist.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,10 @@ public function get_posts_terms($single, $tax) {
344344
private function get_pt_params($tax) {
345345
$taxonomies = ['cat' => 'category', 'tag' => 'post_tag'];
346346
$slug = array_key_exists($tax, $taxonomies) ? $taxonomies[$tax] : '';
347-
if ($this->params["posts_{$tax}s_inner"] == 'script' ) {
347+
if ( !empty( $this->params["posts_{$tax}s_inner"] ) &&
348+
strtolower( tag_escape( $this->params["posts_{$tax}s_inner"] ) ) == 'script' ) {
348349
$this->params["posts_{$tax}s_inner"] = null;
349350
}
350-
$this->params["posts_{$tax}s_inner"] = sanitize_text_field($this->params["posts_{$tax}s_inner"]);
351351
return array(
352352
'tax_slug' => $slug,
353353
'link' => 'yes' === $this->params["posts_{$tax}link"] ? true : false,

include/lcp-thumbnail.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function get_thumbnail($single, $thumbnail, $thumbnail_size, $force_thumb
5858

5959
$lcp_thumbnail .= '<img src="' . esc_url($imgMatches[1]) . '" ';
6060
if ( $lcp_thumb_class != null ) { // thumbnail class passed as parameter to shortcode
61-
$lcp_thumbnail .= 'class="' . esc_html($lcp_thumb_class) . '" ';
61+
$lcp_thumbnail .= 'class="' . LcpUtils::sanitize_html_classes($lcp_thumb_class) . '" ';
6262
}
6363
else { // Otherwise, use this class name
6464
$lcp_thumbnail .= 'class="lcp_thumbnail" ';
@@ -74,7 +74,6 @@ public function get_thumbnail($single, $thumbnail, $thumbnail_size, $force_thumb
7474

7575
private function check_youtube_thumbnail($single, $lcp_thumb_class){
7676
$content = $single->content;
77-
7877
# youtube.com/watch?v=id
7978
$yt_pattern = '/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/)([a-zA-Z0-9\-\_]{11})([^<\s]*)/';
8079
# youtube.com/v[id]
@@ -96,7 +95,7 @@ private function check_youtube_thumbnail($single, $lcp_thumb_class){
9695
$lcp_ytimage = '<img src="' . $imageurl . '" alt="' . $single->post_title . '" />';
9796

9897
if ($lcp_thumb_class != null){
99-
$thmbn_class = ' class="' . esc_html($lcp_thumb_class) . '" />';
98+
$thmbn_class = ' class="' . LcpUtils::sanitize_html_classes($lcp_thumb_class) . '" />';
10099
$lcp_ytimage = preg_replace("/\>/", $thmbn_class, $lcp_ytimage);
101100
}
102101
return '<a href="' . get_permalink($single->ID).'">' . $lcp_ytimage . '</a>';

0 commit comments

Comments
 (0)