Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Magento2.Legacy.EscapeMethodsOnBlockClass #602

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions view/frontend/templates/category/subcategory-links.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ $subCategoriesCollection = $block->getSubCategories();
<ul class="subcategory-links">
<?php foreach ($subCategoriesCollection as $category) { ?>
<li>
<?php $categoryTitle = $block->escapeHtml($category->getTitle()) ?>
<a href="<?= $block->escapeUrl($category->getCategoryUrl()) ?>"
<?php $categoryTitle = $escaper->escapeHtml($category->getTitle()) ?>
<a href="<?= $escaper->escapeUrl($category->getCategoryUrl()) ?>"
title="<?= /*@noEscape*/ $categoryTitle ?>">
<?= /*@noEscape*/ $categoryTitle ?>
</a>
Expand Down
52 changes: 26 additions & 26 deletions view/frontend/templates/post/info.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,57 +20,57 @@
<?php if ($_post->isPublishDateEnabled()) { ?>
<div class="item post-posed-date">
<i class="mf-blog-icon mfbi-calendar"></i>
<span class="label"><?= $block->escapeHtml(__('Posted:')) ?></span>
<span class="value"><?= $block->escapeHtml($_post->getPublishDate()) ?></span>
<span class="label"><?= $escaper->escapeHtml(__('Posted:')) ?></span>
<span class="value"><?= $escaper->escapeHtml($_post->getPublishDate()) ?></span>
</div>
<?php } ?>
<?php if ($_categoriesCount = $_post->getCategoriesCount()) { ?>
<div class="item post-categories">
<i class="mf-blog-icon mfbi-folder"></i>
<span class="label"><?= $block->escapeHtml(__('Categories:')) ?></span>
<span class="label"><?= $escaper->escapeHtml(__('Categories:')) ?></span>
<?php $n = 0; ?>
<?php foreach ($_post->getParentCategories() as $ct) { ?>
<?php $n++; ?>
<a title="<?= $block->escapeHtml($ct->getTitle()) ?>"
href="<?= $block->escapeUrl($ct->getCategoryUrl()) ?>"
><?= $block->escapeHtml($ct->getTitle()) ?></a><?= /*@noEscape*/ ($n != $_categoriesCount) ? ',' : '' ?>
<a title="<?= $escaper->escapeHtml($ct->getTitle()) ?>"
href="<?= $escaper->escapeUrl($ct->getCategoryUrl()) ?>"
><?= $escaper->escapeHtml($ct->getTitle()) ?></a><?= /*@noEscape*/ ($n != $_categoriesCount) ? ',' : '' ?>
<?php } ?>
</div>
<?php } ?>
<?php if ($block->magefanCommentsEnabled() && $_post->getCommentsCount()) { ?>
<div class="item post-comments">
<i class="mf-blog-icon mfbi-comments"></i>
<span class="label"><?= $block->escapeHtml(__('Comments:')) ?></span>
<a title="<?= $block->escapeHtml($_post->getTitle()) ?>"
href="<?= $block->escapeUrl($_post->getPostUrl()) ?>#post-comments"
><?= $block->escapeHtml($_post->getCommentsCount()) ?></a>
<span class="label"><?= $escaper->escapeHtml(__('Comments:')) ?></span>
<a title="<?= $escaper->escapeHtml($_post->getTitle()) ?>"
href="<?= $escaper->escapeUrl($_post->getPostUrl()) ?>#post-comments"
><?= $escaper->escapeHtml($_post->getCommentsCount()) ?></a>
</div>
<?php } ?>
<?php if ($_tagsCount = $_post->getTagsCount()) { ?>
<div class="item post-tags">
<div class="mf-blog-icon mfbi-tags"></div>
<span class="label"><?= $block->escapeHtml(__('Tags:')) ?></span>
<span class="label"><?= $escaper->escapeHtml(__('Tags:')) ?></span>
<?php $n = 0; ?>
<?php foreach ($_post->getRelatedTags() as $tag) { ?>
<?php $n++; ?>
<a title="<?= $block->escapeHtml($tag->getTitle()) ?>"
href="<?= $block->escapeUrl($tag->getTagUrl()) ?>"
><?= $block->escapeHtml($tag->getTitle()) ?></a><?= ($n != $_tagsCount) ? ',' : '' ?>
<a title="<?= $escaper->escapeHtml($tag->getTitle()) ?>"
href="<?= $escaper->escapeUrl($tag->getTagUrl()) ?>"
><?= $escaper->escapeHtml($tag->getTitle()) ?></a><?= ($n != $_tagsCount) ? ',' : '' ?>
<?php } ?>
</div>
<?php } ?>
<?php if ($block->authorEnabled()) { ?>
<?php if ($_author = $_post->getAuthor()) { ?>
<div class="item post-author">
<i class="mf-blog-icon mfbi-user"></i>
<span class="label"><?= $block->escapeHtml(__('Author:')) ?></span>
<span class="label"><?= $escaper->escapeHtml(__('Author:')) ?></span>
<span class="value">
<?php if ($authorPageEnabled = $block->authorPageEnabled()) { ?>
<a title="<?= $block->escapeHtml($_author->getTitle()) ?>"
href="<?= $block->escapeUrl($_author->getAuthorUrl()) ?>">
<a title="<?= $escaper->escapeHtml($_author->getTitle()) ?>"
href="<?= $escaper->escapeUrl($_author->getAuthorUrl()) ?>">
<?php } ?>

<?= $block->escapeHtml($_author->getTitle()) ?>
<?= $escaper->escapeHtml($_author->getTitle()) ?>

<?php if ($authorPageEnabled) { ?>
</a>
Expand All @@ -81,15 +81,15 @@
$coAuthorsCount = count($coAuthors);
?>
<?php if ($coAuthorsCount) { ?>
<?= $block->escapeHtml(__('and')) ?>
<?= $escaper->escapeHtml(__('and')) ?>
<?php $z = 0 ?>
<?php foreach($coAuthors as $coAuthor) { ?>
<?php foreach ($coAuthors as $coAuthor) { ?>
<?php $z++; ?>
<?php if ($block->authorPageEnabled()) { ?>
<a title="<?= $block->escapeHtml($coAuthor->getTitle()) ?>"
href="<?= $block->escapeUrl($coAuthor->getAuthorUrl()) ?>"><?= $block->escapeHtml($coAuthor->getTitle()) ?></a><?php if ($z != $coAuthorsCount) echo ', ' ?>
<a title="<?= $escaper->escapeHtml($coAuthor->getTitle()) ?>"
href="<?= $escaper->escapeUrl($coAuthor->getAuthorUrl()) ?>"><?= $escaper->escapeHtml($coAuthor->getTitle()) ?></a><?php if ($z != $coAuthorsCount) { echo ', '; } ?>
<?php } else { ?>
<?= $block->escapeHtml($coAuthor->getTitle()) ?><?php if ($z != $coAuthorsCount) echo ', ' ?>
<?= $escaper->escapeHtml($coAuthor->getTitle()) ?><?php if ($z != $coAuthorsCount) { echo ', '; } ?>
<?php } ?>
<?php } ?>
<?php } ?>
Expand All @@ -104,9 +104,9 @@
<?php if ($viewsCount = $_post->getViewsCount()) { ?>
<div class="item post-views">
<i class="mf-blog-icon mfbi-views"></i>
<span class="label"><?= $block->escapeHtml(__('Views:')) ?></span>
<span class="label"><?= $escaper->escapeHtml(__('Views:')) ?></span>
<span class="value">
<?= $block->escapeHtml($viewsCount)?>
<?= $escaper->escapeHtml($viewsCount)?>
</span>
</div>
<?php } ?>
Expand All @@ -116,7 +116,7 @@
<?php if ($block->readingTimeEnabled() && $_post->getReadingTime()) { ?>
<div class="item post-reading-time">
<i class="mf-blog-icon mfbi-reading-time"></i>
<span class="value"><?= $block->escapeHtml($_post->getReadingTime()) . ' ' . __('min read') ?></span>
<span class="value"><?= $escaper->escapeHtml($_post->getReadingTime()) . ' ' . __('min read') ?></span>
</div>
<?php } ?>

Expand Down
8 changes: 4 additions & 4 deletions view/frontend/templates/post/links.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<?php if (!$postCollection->count()) { ?>
<div class="message info empty">
<div>
<?= $block->escapeHtml(__('We can\'t find posts matching the selection.')) ?>
<?= $escaper->escapeHtml(__('We can\'t find posts matching the selection.')) ?>
</div>
</div>
<?php } else { ?>
Expand All @@ -30,9 +30,9 @@
<?php foreach ($postCollection as $post): ?>
<li>
<?php $postTitle = $post->getTitle() ?>
<a href="<?= $block->escapeUrl($post->getPostUrl()) ?>"
title="<?= $block->escapeHtml($postTitle) ?>">
<?= $block->escapeHtml($postTitle) ?>
<a href="<?= $escaper->escapeUrl($post->getPostUrl()) ?>"
title="<?= $escaper->escapeHtml($postTitle) ?>">
<?= $escaper->escapeHtml($postTitle) ?>
</a>
</li>
<?php endforeach; ?>
Expand Down
36 changes: 18 additions & 18 deletions view/frontend/templates/post/list-modern.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class);
<?php if (!$_postCollection->count()): ?>
<div class="message info empty">
<div>
<?= $block->escapeHtml(__('We can\'t find posts matching the selection.')) ?>
<?= $escaper->escapeHtml(__('We can\'t find posts matching the selection.')) ?>
</div>
</div>
<?php else: ?>
Expand All @@ -33,8 +33,8 @@ $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class);
<ol class="post-list modern">
<?php foreach ($_postCollection as $_post): ?>
<?php
$_postUrl = $block->escapeUrl($_post->getPostUrl());
$_postName = $block->escapeHtml($_post->getTitle());
$_postUrl = $escaper->escapeUrl($_post->getPostUrl());
$_postName = $escaper->escapeHtml($_post->getTitle());
?>
<li class="post-item post-holder post-holder-<?= (int)$_post->getId() ?>">

Expand All @@ -58,7 +58,7 @@ $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class);
$featuredImgAlt = $_postName;
}
?>
<div class="animation-type-zoom bg-img mfblogunveil" data-original="<?= $block->escapeHtml($featuredImage) ?>"></div>
<div class="animation-type-zoom bg-img mfblogunveil" data-original="<?= $escaper->escapeHtml($featuredImage) ?>"></div>
<?php /* <img class="" src="<?= $block->escapeHtml($featuredImage) ?>" alt=""> */ ?>
<?php } ?>
</a>
Expand All @@ -67,9 +67,9 @@ $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class);
<?php if ($_categoriesCount = $_post->getCategoriesCount()) { ?>
<span class="post-category">
<?php foreach ($_post->getParentCategories() as $ct) { ?>
<a class="category-name" href="<?= $block->escapeUrl($ct->getCategoryUrl()) ?>"
title="<?= $block->escapeHtml($ct->getTitle()) ?>">
<?= $block->escapeHtml($ct->getTitle()) ?>
<a class="category-name" href="<?= $escaper->escapeUrl($ct->getCategoryUrl()) ?>"
title="<?= $escaper->escapeHtml($ct->getTitle()) ?>">
<?= $escaper->escapeHtml($ct->getTitle()) ?>
</a>
<?php } ?>
</span>
Expand All @@ -94,27 +94,27 @@ $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class);
<?php if ($_author = $_post->getAuthor()) { ?>
<span class="post-author-name">
<?php if ($block->authorPageEnabled()) { ?>
<a title="<?= $block->escapeHtml($_author->getTitle()) ?>"
href="<?= $block->escapeUrl($_author->getAuthorUrl()) ?>"><?= $block->escapeHtml($_author->getTitle()) ?>
<a title="<?= $escaper->escapeHtml($_author->getTitle()) ?>"
href="<?= $escaper->escapeUrl($_author->getAuthorUrl()) ?>"><?= $escaper->escapeHtml($_author->getTitle()) ?>
</a>
<?php } else { ?>
<?= $block->escapeHtml($_author->getTitle()) ?>
<?= $escaper->escapeHtml($_author->getTitle()) ?>
<?php } ?>

<?php
$coAuthors = $_post->getRelatedCoauthors();
$coAuthorsCount = count($coAuthors);
?>
<?php if ($coAuthorsCount) { ?>
<?= $block->escapeHtml(__('and')) ?>
<?= $escaper->escapeHtml(__('and')) ?>
<?php $z = 0 ?>
<?php foreach($coAuthors as $coAuthor) { ?>
<?php foreach ($coAuthors as $coAuthor) { ?>
<?php $z++; ?>
<?php if ($block->authorPageEnabled()) { ?>
<a title="<?= $block->escapeHtml($coAuthor->getTitle()) ?>"
href="<?= $block->escapeUrl($coAuthor->getAuthorUrl()) ?>"><?= $block->escapeHtml($coAuthor->getTitle()) ?></a><?php if ($z != $coAuthorsCount) echo ', ' ?>
<a title="<?= $escaper->escapeHtml($coAuthor->getTitle()) ?>"
href="<?= $escaper->escapeUrl($coAuthor->getAuthorUrl()) ?>"><?= $escaper->escapeHtml($coAuthor->getTitle()) ?></a><?php if ($z != $coAuthorsCount) { echo ', '; } ?>
<?php } else { ?>
<?= $block->escapeHtml($coAuthor->getTitle()) ?><?php if ($z != $coAuthorsCount) echo ', ' ?>
<?= $escaper->escapeHtml($coAuthor->getTitle()) ?><?php if ($z != $coAuthorsCount) { echo ', '; } ?>
<?php } ?>
<?php } ?>
<?php } ?>
Expand All @@ -125,14 +125,14 @@ $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class);

<!-- post date -->
<?php if ($_post->isPublishDateEnabled()) { ?>
<span class="post-date"><?= $block->escapeHtml($_post->getPublishDate()) ?></span>
<span class="post-date"><?= $escaper->escapeHtml($_post->getPublishDate()) ?></span>
<?php } ?>

<!-- post view -->
<?php if ($block->viewsCountEnabled()) { ?>
<?php if ($viewsCount = $_post->getViewsCount()) { ?>
<span class="post-view float-right d-none d-md-block">
<?= $block->escapeHtml($viewsCount)?>
<?= $escaper->escapeHtml($viewsCount)?>
</span>
<?php } ?>
<?php } ?>
Expand All @@ -146,7 +146,7 @@ $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class);
<!-- read more -->
<div class="post-read-more">
<a class="action primary" href="<?= /*@noEscape*/ $_postUrl ?>" title="<?= /*@noEscape*/ $_postName ?>">
<?= $block->escapeHtml(__('Read more')) ?>
<?= $escaper->escapeHtml(__('Read more')) ?>
</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/templates/post/list.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $_postCollection = $block->getPostCollection();
<?php if (!$_postCollection->count()): ?>
<div class="message info empty">
<div>
<?= $block->escapeHtml(__('We can\'t find posts matching the selection.')) ?>
<?= $escaper->escapeHtml(__('We can\'t find posts matching the selection.')) ?>
</div>
</div>
<?php else: ?>
Expand Down
Loading