-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bugfix/MAGE-948: DOM selector check (#1550) * MAGE-3 Checking on exists element fix (#1516) Co-authored-by: andreishichko <[email protected]> * MAGE-948: use if statement over ternary * MAGE-948: remove optional chaining --------- Co-authored-by: sgeleon <[email protected]> Co-authored-by: andreishichko <[email protected]> * MAGE-947: restrict recommend CSS to algolia managed blocks (#1553) * MAGE-947: restrict recommend CSS to algolia managed blocks * MAGE-947: add css identifer to all rules * MAGE-949: add fallback for secureRenderer (#1556) * Removed polyfill.io from csp_whitelist, was forgotten in MAGE-822 * MAGE-901: showing title for empty recommendation issue addressed * MAGE-901: code updated as per code review suggestions * MAGE-958: release number increased and change log updated * MAGE-958: change log updated. --------- Co-authored-by: Damien Couchez <[email protected]> Co-authored-by: sgeleon <[email protected]> Co-authored-by: andreishichko <[email protected]> Co-authored-by: Pieter Hoste <[email protected]> Co-authored-by: Eric Wright <[email protected]>
- Loading branch information
1 parent
1a26fce
commit 72622b6
Showing
13 changed files
with
120 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,31 @@ | ||
<?php | ||
|
||
/** @var \Algolia\AlgoliaSearch\Block\Configuration $block */ | ||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ | ||
|
||
$configuration = $block->getConfiguration(); | ||
|
||
?> | ||
if (class_exists('\Magento\Framework\View\Helper\SecureHtmlRenderer')) : ?> | ||
<?php | ||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ | ||
if ($configuration['instant']['enabled'] === true && $configuration['isSearchPage'] === true) { | ||
$css = /* @noEscape */ $secureRenderer->renderTag('style', [], $configuration['instant']['selector'] . ' {display:none}', false); | ||
/* @noEscape */ echo $secureRenderer->renderTag('script', [], 'document.write(\'' . $css . '\');' , false); | ||
} | ||
?> | ||
|
||
<?php | ||
if ($configuration['instant']['enabled'] === true && $configuration['isSearchPage'] === true) { | ||
$css = /* @noEscape */ $secureRenderer->renderTag('style', [], $configuration['instant']['selector'] . ' {display:none}', false); | ||
/* @noEscape */ echo $secureRenderer->renderTag('script', [], 'document.write(\'' . $css . '\');' , false); | ||
} | ||
?> | ||
|
||
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], "window.algoliaConfig = " . json_encode($configuration) . ';' , false); ?> | ||
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], "window.algoliaConfig = " . json_encode($configuration) . ';' , false); ?> | ||
<?php else: ?> | ||
<script> | ||
<?php | ||
if ($configuration['instant']['enabled'] === true && $configuration['isSearchPage'] === true) : | ||
$css = '<style type="text/css">' . $configuration['instant']['selector'] . ' {display:none}</style>'; | ||
?> | ||
// Hide the instant-search selector ASAP to remove flickering. Will be re-displayed later with JS. | ||
document.write('<?php /* @noEscape */ echo $css; ?>'); | ||
<?php | ||
endif; | ||
?> | ||
|
||
window.algoliaConfig = <?php /* @noEscape */ echo json_encode($configuration); ?>; | ||
</script> | ||
<?php endif; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72622b6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
11% 1 sec 147.0 MiBPHP Parse error: syntax error, unexpected 'CurrentCategory' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /vendor/algolia/algoliasearch-magento-2/Block/Algolia.php on line 102