From 15617e65bfa72c586cf4c9e9d780fdd54f539788 Mon Sep 17 00:00:00 2001
From: Jonas Leder <jonas@jonasled.de>
Date: Sat, 2 Jan 2021 00:49:27 +0100
Subject: [PATCH] add onion tracking on 500 page

---
 public/internal/500.php | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/public/internal/500.php b/public/internal/500.php
index 75221aa..95a847a 100644
--- a/public/internal/500.php
+++ b/public/internal/500.php
@@ -1,6 +1,15 @@
 <?php
+
 function getError500()
 {
+    include "config.php";
+
+    if (strpos($_SERVER['HTTP_HOST'], '.onion') !== false) {
+        $trackURL = $trackURLTor;
+    } else {
+        $trackURL = $trackURLNormal;
+    }
+
     return <<<EOF
     <!DOCTYPE html>
     <html lang="en">
@@ -13,7 +22,7 @@ function getError500()
        </head>
        <body>
           <!-- Matomo Image Tracker-->
-          <img src="https://matomo.jonasled.de/matomo.php?idsite=1&amp;rec=1" style="border:0" alt="" />
+          <img src="$trackURL" style="border:0" alt="" />
           <!-- End Matomo -->
           <div id="particles-js"></div>
           <div class="terminal-window">
-- 
GitLab