Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2018-10-08 17:02:30 +0300
committerPhie <phie@phie.ovh>2018-10-08 17:02:30 +0300
commitc80b2c94b5888b7dbd06958efe96c372ca8e1d51 (patch)
treefb12a81cdeab329650cbae7e1731a4aae0aa2693 /templates/index.php
parent2e246f5a7a0f363227d4f899215d71206d6a593a (diff)
using more conventionnal ways to get path
Diffstat (limited to 'templates/index.php')
-rwxr-xr-xtemplates/index.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/templates/index.php b/templates/index.php
index 9386b1a..acc52a0 100755
--- a/templates/index.php
+++ b/templates/index.php
@@ -1,10 +1,7 @@
<?php
-$currentpath = substr(get_defined_vars()["file"],0, -strlen("index.php"))."/CarnetElectron/";
-$root = substr(__DIR__, strlen($_SERVER['DOCUMENT_ROOT']));
-if (strpos(__DIR__, '/snap/') !== false) {
- $root = "/extra-apps/carnet/templates";
-}
+$currentpath = __DIR__."/CarnetElectron/";
+$root = \OCP\Util::linkToAbsolute("carnet","templates");
$file = file_get_contents($currentpath."index.html");
//
$file = str_replace("href=\"","href=\"".$root."/CarnetElectron/",$file);