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>2019-02-07 21:02:30 +0300
committerPhie <phie@phie.ovh>2019-02-07 21:03:03 +0300
commitc545ba6ed64341bfd680eea6c6030d367f02231a (patch)
treed392f2c5c16a72104b9478a81ae10a86e50f82e5
parent24c6eac455153a3a30f2460f637d4d2fd4c93693 (diff)
still fixing issues with https
-rw-r--r--CHANGELOG.md4
-rwxr-xr-xappinfo/info.xml2
-rwxr-xr-xtemplates/index.php6
-rwxr-xr-xtemplates/settings.php5
-rwxr-xr-xtemplates/writer.php6
5 files changed, 9 insertions, 14 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index edeaefa..66d878d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+# Version 0.12.1
+
+Fix issue with reverse proxies
+
# Version 0.12.0
Todo-List (in editor, tools)
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 8d097fb..ed09386 100755
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -18,7 +18,7 @@ Mac, with sync capabilities
- Statistics : words/sentences/characters
- Sync with NextCloud
- Online editor as a NextCloud App]]></description>
- <version>0.12.0</version>
+ <version>0.12.1</version>
<licence>agpl</licence>
<author mail="phie@phie.ovh" >Phie</author>
<namespace>Carnet</namespace>
diff --git a/templates/index.php b/templates/index.php
index 4795f16..ec285c0 100755
--- a/templates/index.php
+++ b/templates/index.php
@@ -3,12 +3,8 @@ global $currentpath;
global $root;
$currentpath = __DIR__."/CarnetElectron/";
$root = \OCP\Util::linkToAbsolute("carnet","templates");
-if(strpos($root,"http://") === 0 && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'){
- //should be https...
- $root = "https".substr($root,strlen("http"));
-}
$file = file_get_contents($currentpath."index.html");
-//
+$root = parse_url($root, PHP_URL_PATH);
$file = preg_replace_callback('/<link(.*?)href=\"(.*?\.css(?:\?.*?)?)"/s',function ($matches) {
global $currentpath;
diff --git a/templates/settings.php b/templates/settings.php
index f54569d..eec7a7d 100755
--- a/templates/settings.php
+++ b/templates/settings.php
@@ -2,10 +2,7 @@
$currentpath = __DIR__."/CarnetElectron/";
$root = \OCP\Util::linkToAbsolute("carnet","templates");
-if(strpos($root,"http://") === 0 && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'){
- //should be https...
- $root = "https".substr($root,strlen("http"));
-}
+$root = parse_url($root, PHP_URL_PATH);
$file = file_get_contents($currentpath."settings.html");
//
diff --git a/templates/writer.php b/templates/writer.php
index 3c9cb8f..b877a7c 100755
--- a/templates/writer.php
+++ b/templates/writer.php
@@ -3,10 +3,8 @@ global $currentpath;
global $root;
$currentpath = __DIR__."/CarnetElectron/";
$root = \OCP\Util::linkToAbsolute("carnet","templates");
-if(strpos($root,"http://") === 0 && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'){
- //should be https...
- $root = "https".substr($root,strlen("http"));
-}
+$root = parse_url($root, PHP_URL_PATH);
+
$file = file_get_contents($currentpath."reader/reader.html");
$file = preg_replace_callback('/<script(.*?)src=\"(.*?\.js(?:\?.*?)?)"/s',function ($matches) {