From 6e22fc17d2df7f7c3636b9064c4016fefb88e7f9 Mon Sep 17 00:00:00 2001 From: Carsten Ringe Date: Tue, 9 Jun 2015 19:51:01 +0200 Subject: Use config option BASE_URL in getPocheUrl() --- inc/poche/Tools.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index d0b31d4f..d3dddd3b 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -72,8 +72,14 @@ final class Tools $serverport = ''; } - return 'http' . ($https ? 's' : '') . '://' - . $host . $serverport . $scriptname; + // check if BASE_URL is configured + if(BASE_URL != null && BASE_URL != '') { + $baseUrl = BASE_URL; + } else { + $baseUrl = 'http' . ($https ? 's' : '') . '://' . $host . $serverport; + } + + return $baseUrl . $scriptname; } /** -- cgit v1.2.3 From 984805649e38c0fc83cde0345ac99b74c8b66e61 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 29 Jun 2015 15:52:55 +0200 Subject: fix BASE_URL --- inc/poche/Tools.class.php | 18 +++++++++++------- inc/poche/config.inc.default.php | 3 +++ 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'inc') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 15050aed..6c176eae 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -40,6 +40,8 @@ final class Tools */ public static function getPocheUrl() { + $baseUrl = ""; + $https = (!empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on')) || (isset($_SERVER["SERVER_PORT"]) @@ -72,14 +74,16 @@ final class Tools $serverport = ''; } - // check if BASE_URL is configured - if(BASE_URL != null && BASE_URL != '') { - $baseUrl = BASE_URL; - } else { - $baseUrl = 'http' . ($https ? 's' : '') . '://' . $host . $serverport; - } + // check if BASE_URL is configured + if(BASE_URL) { + print_r(BASE_URL); + $baseUrl = BASE_URL; + } else { + $baseUrl = 'http' . ($https ? 's' : '') . '://' . $host . $serverport; + } - return $baseUrl . $scriptname; + return $baseUrl . $scriptname; + } /** 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 @@ // Change this if not using the standart port for SSL - i.e you server is behind sslh @define ('SSL_PORT', 443); +// Define this only if you use wallabag behind a proxy and if you encounter problems +@define ('BASE_URL', ''); + @define ('MODE_DEMO', FALSE); @define ('DEBUG_POCHE', FALSE); -- cgit v1.2.3 From 85fb64c207df60bffef2688ef070bff59a6e6dbe Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 29 Jun 2015 15:57:19 +0200 Subject: delete the debug call --- inc/poche/Tools.class.php | 1 - 1 file changed, 1 deletion(-) (limited to 'inc') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 6c176eae..9c748391 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -76,7 +76,6 @@ final class Tools // check if BASE_URL is configured if(BASE_URL) { - print_r(BASE_URL); $baseUrl = BASE_URL; } else { $baseUrl = 'http' . ($https ? 's' : '') . '://' . $host . $serverport; -- cgit v1.2.3