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(-) 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