aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-07-29 11:43:22 +0200
committerThomas Citharel <tcit@tcit.fr>2015-07-29 11:43:22 +0200
commitef16095d626dd5c7fe74db86327452b4fac83e5f (patch)
tree71802ffa0849a26dee4afeae8ce78335d094af39 /inc
parent0cb2c31437d8cacbc23f7aa36cac2f0b3c323541 (diff)
parent85fb64c207df60bffef2688ef070bff59a6e6dbe (diff)
downloadwallabag-ef16095d626dd5c7fe74db86327452b4fac83e5f.tar.gz
wallabag-ef16095d626dd5c7fe74db86327452b4fac83e5f.tar.zst
wallabag-ef16095d626dd5c7fe74db86327452b4fac83e5f.zip
Merge pull request #1226 from wallabag/MoriTanosuke-dev
Enable base_url for proxies
Diffstat (limited to 'inc')
-rwxr-xr-xinc/poche/Tools.class.php13
-rwxr-xr-xinc/poche/config.inc.default.php3
2 files changed, 14 insertions, 2 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php
index f3d1013f..9c748391 100755
--- a/inc/poche/Tools.class.php
+++ b/inc/poche/Tools.class.php
@@ -40,6 +40,8 @@ final class Tools
40 */ 40 */
41 public static function getPocheUrl() 41 public static function getPocheUrl()
42 { 42 {
43 $baseUrl = "";
44
43 $https = (!empty($_SERVER['HTTPS']) 45 $https = (!empty($_SERVER['HTTPS'])
44 && (strtolower($_SERVER['HTTPS']) == 'on')) 46 && (strtolower($_SERVER['HTTPS']) == 'on'))
45 || (isset($_SERVER["SERVER_PORT"]) 47 || (isset($_SERVER["SERVER_PORT"])
@@ -72,8 +74,15 @@ final class Tools
72 $serverport = ''; 74 $serverport = '';
73 } 75 }
74 76
75 return 'http' . ($https ? 's' : '') . '://' 77 // check if BASE_URL is configured
76 . $host . $serverport . $scriptname; 78 if(BASE_URL) {
79 $baseUrl = BASE_URL;
80 } else {
81 $baseUrl = 'http' . ($https ? 's' : '') . '://' . $host . $serverport;
82 }
83
84 return $baseUrl . $scriptname;
85
77 } 86 }
78 87
79 /** 88 /**
diff --git a/inc/poche/config.inc.default.php b/inc/poche/config.inc.default.php
index 09d3aa9a..5d889ffd 100755
--- a/inc/poche/config.inc.default.php
+++ b/inc/poche/config.inc.default.php
@@ -31,6 +31,9 @@
31// Change this if not using the standart port for SSL - i.e you server is behind sslh 31// Change this if not using the standart port for SSL - i.e you server is behind sslh
32@define ('SSL_PORT', 443); 32@define ('SSL_PORT', 443);
33 33
34// Define this only if you use wallabag behind a proxy and if you encounter problems
35@define ('BASE_URL', '');
36
34@define ('MODE_DEMO', FALSE); 37@define ('MODE_DEMO', FALSE);
35@define ('DEBUG_POCHE', FALSE); 38@define ('DEBUG_POCHE', FALSE);
36 39