File: 0019-Disable-all-searching-for-.git-deployments.patch

package info (click to toggle)
matomo 5.3.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 72,652 kB
  • sloc: php: 230,070; javascript: 103,748; python: 196; xml: 188; sh: 156; makefile: 13; sql: 10
file content (45 lines) | stat: -rw-r--r-- 1,627 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From: William Desportes <williamdes@wdes.fr>
Date: Sun, 15 Dec 2024 23:48:21 +0100
Subject: Disable all searching for .git deployments

Origin: vendor
Forwarded: not-needed
---
 core/AssetManager/UIAssetCacheBuster.php | 2 +-
 core/SettingsPiwik.php                   | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/AssetManager/UIAssetCacheBuster.php b/core/AssetManager/UIAssetCacheBuster.php
index e0f8c1f..690dcbd 100644
--- a/core/AssetManager/UIAssetCacheBuster.php
+++ b/core/AssetManager/UIAssetCacheBuster.php
@@ -33,7 +33,7 @@ class UIAssetCacheBuster extends Singleton
 
         if (empty($cachedCacheBuster) || $pluginNames !== false) {
             $masterFile     = PIWIK_INCLUDE_PATH . '/.git/refs/heads/master';
-            $currentGitHash = file_exists($masterFile) ? @file_get_contents($masterFile) : '';
+            $currentGitHash = '';
             $manager = Manager::getInstance();
 
             $plugins = !$pluginNames ? $manager->getActivatedPlugins() : $pluginNames;
diff --git a/core/SettingsPiwik.php b/core/SettingsPiwik.php
index 0705000..b675b9b 100644
--- a/core/SettingsPiwik.php
+++ b/core/SettingsPiwik.php
@@ -428,6 +428,7 @@ class SettingsPiwik
      */
     public static function isGitDeployment(): bool
     {
+        return false;
         return file_exists(PIWIK_INCLUDE_PATH . '/.git/HEAD');
     }
 
@@ -436,6 +437,8 @@ class SettingsPiwik
      */
     public static function getCurrentGitBranch(): string
     {
+        return '';
+
         $file = PIWIK_INCLUDE_PATH . '/.git/HEAD';
         if (!file_exists($file)) {
             return '';