]> _ Git - bastide-resah.git/commitdiff
wip #6889 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 30 Apr 2024 17:34:34 +0000 (19:34 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 30 Apr 2024 17:34:34 +0000 (19:34 +0200)
app/Http/Controllers/CatalogController.php

index 231ce90957b0740300b80293c32313d70ae7e263..97f4cca5ac9873918bdb2002a03e0bfbb382029f 100644 (file)
@@ -21,11 +21,10 @@ class CatalogController extends Controller
         $relayPath = base_path($cpath) . '/' . $path;
 
         $user = Auth::guard('client')->user();
-        if ($path === 'index.html' && $user) {
+        if ($path === 'index.html' && $user !== null) {
             $html = file_get_contents($relayPath);
-            $html = str_replace('</head>', '<script>MATOMO_USER_ID="' . $user->email . '";</script></head>', $html);
+            $html = str_replace('<head>', '<head><script type="text/javascript">var MATOMO_USER_ID="' . $user->email . '";</script>', $html);
             return response($html)->header('Content-Type', 'text/html');
-
         }
 
         return XSendFileController::sendfileNoCache($relayPath);