]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
fix BASE_URL
authorThomas Citharel <tcit@tcit.fr>
Mon, 29 Jun 2015 13:52:55 +0000 (15:52 +0200)
committerThomas Citharel <tcit@tcit.fr>
Mon, 29 Jun 2015 13:52:55 +0000 (15:52 +0200)
inc/poche/Tools.class.php
inc/poche/config.inc.default.php

index 15050aed9b6c15e0b25cb3fdc02596d0d341048e..6c176eae5c3048dd53368284aed2a1988f69647f 100755 (executable)
@@ -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;
+    
     }
 
     /**
index 09d3aa9aeaaac404ff2e0ef961b3ab7574185f28..5d889ffdb0b4b7efd1603891c8350eda37227c4a 100755 (executable)
@@ -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);