diff options
author | Phie <phie@phie.ovh> | 2018-10-08 17:02:30 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2018-10-08 17:02:30 +0300 |
commit | c80b2c94b5888b7dbd06958efe96c372ca8e1d51 (patch) | |
tree | fb12a81cdeab329650cbae7e1731a4aae0aa2693 /templates/index.php | |
parent | 2e246f5a7a0f363227d4f899215d71206d6a593a (diff) |
using more conventionnal ways to get path
Diffstat (limited to 'templates/index.php')
-rwxr-xr-x | templates/index.php | 7 |
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); |