File: css-issue-270.patch

package info (click to toggle)
zoph 1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,632 kB
  • sloc: php: 28,044; javascript: 10,435; sql: 527; sh: 153; makefile: 4
file content (34 lines) | stat: -rw-r--r-- 1,498 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
Description: patch for upstream css issue 270
Origin: upstream, https://gitlab.com/zoph-project/zoph/-/issues/?sort=created_date&state=closed&first_page_size=20
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: zoph/php/classes/template/template.inc.php
===================================================================
--- zoph.orig/php/classes/template/template.inc.php	2025-02-03 19:19:47.770422786 +0000
+++ zoph/php/classes/template/template.inc.php	2025-02-03 19:22:42.155364913 +0000
@@ -93,14 +93,13 @@
     }
 
     public static function getFile(string $dir, string $filename) {
-        $basepath = app::getBasePath();
         $tpl=conf::get("interface.template");
         if (preg_match("/^[A-Za-z0-9_\-\/\.]+$/", $filename) && !preg_match("/\.\./", $filename)) {
             $file="templates/" . $tpl . "/" . $dir . "/" . $filename;
             if (!file_exists($file)) {
                 $file="templates/default/" . $dir . "/" . $filename;
             }
-            return $basepath . $file;
+            return "/" . $file;
         } else {
             log::msg("Illegal characters in file name", log::FATAL, log::GENERAL);
         }
@@ -115,7 +114,8 @@
      * @return string relative image url
      */
     public static function getImage(string $image) {
-        return self::getFile("images", $image);
+        $path = app::getBasePath() . self::getFile("images", $image);
+        return str_replace("//", "/", $path);
     }
 
     /**