Skip to content

Commit 91b5f60

Browse files
committed
feat: enhance Magewire detection in InspectorHints for diverse requests
1 parent 093983c commit 91b5f60

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/Model/TemplateEngine/Plugin/InspectorHints.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,18 @@ public function afterCreate(
8282
}
8383

8484
// Additional check for Magewire if not sent as XHR or checkout page
85+
// Check diverse Request URI and Path Info variations to catch all Magewire output
8586
$requestUri = $this->request->getRequestUri();
86-
if ($requestUri) {
87-
if (strpos($requestUri, 'magewire') !== false) {
88-
return $invocationResult;
89-
}
87+
$pathInfo = $this->request->getPathInfo();
88+
89+
if (($requestUri && stripos($requestUri, 'magewire') !== false) ||
90+
($pathInfo && stripos($pathInfo, 'magewire') !== false)) {
91+
return $invocationResult;
92+
}
93+
94+
// Also check regex for partial matches if simple strings fail
95+
if (preg_match('/magewire|livewire/i', (string)$requestUri)) {
96+
return $invocationResult;
9097
}
9198

9299
// Check if inspector is enabled in configuration

0 commit comments

Comments
 (0)