Skip to content

Commit d989d6e

Browse files
authored
Improved check to detect ajax requests
1 parent 68968c4 commit d989d6e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Plugin/BlockPlugin.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,13 @@ public function afterToHtml(\Magento\Framework\View\Element\AbstractBlock $block
105105
*/
106106
protected function isEnabled($block, $html)
107107
{
108-
if (PHP_SAPI === 'cli' || $this->request->isXmlHttpRequest()) {
108+
if (PHP_SAPI === 'cli'
109+
|| $this->request->isXmlHttpRequest()
110+
|| false !== stripos($this->request->getFullActionName(), 'ajax')
111+
|| false !== stripos($this->request->getServer('REQUEST_URI'), 'ajax')
112+
|| $this->request->getParam('ajax')
113+
|| $this->request->getParam('isAjax')
114+
) {
109115
return false;
110116
}
111117

0 commit comments

Comments
 (0)