aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Tools.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/poche/Tools.class.php')
-rwxr-xr-xinc/poche/Tools.class.php22
1 files changed, 6 insertions, 16 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php
index 63137d76..f803e3b5 100755
--- a/inc/poche/Tools.class.php
+++ b/inc/poche/Tools.class.php
@@ -51,9 +51,14 @@ final class Tools
51 51
52 $serverport = (!isset($_SERVER["SERVER_PORT"]) 52 $serverport = (!isset($_SERVER["SERVER_PORT"])
53 || $_SERVER["SERVER_PORT"] == '80' 53 || $_SERVER["SERVER_PORT"] == '80'
54 || $_SERVER["SERVER_PORT"] == HTTP_PORT
54 || ($https && $_SERVER["SERVER_PORT"] == '443') 55 || ($https && $_SERVER["SERVER_PORT"] == '443')
55 || ($https && $_SERVER["SERVER_PORT"]==SSL_PORT) //Custom HTTPS port detection 56 || ($https && $_SERVER["SERVER_PORT"]==SSL_PORT) //Custom HTTPS port detection
56 ? '' : ':' . $_SERVER["SERVER_PORT"]); 57 ? '' : ':' . $_SERVER["SERVER_PORT"]);
58
59 if (isset($_SERVER["HTTP_X_FORWARDED_PORT"])) {
60 $serverport = ':' . $_SERVER["HTTP_X_FORWARDED_PORT"];
61 }
57 62
58 $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]); 63 $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]);
59 64
@@ -112,7 +117,7 @@ final class Tools
112 { 117 {
113 $views = array( 118 $views = array(
114 'install', 'import', 'export', 'config', 'tags', 119 'install', 'import', 'export', 'config', 'tags',
115 'edit-tags', 'view', 'login', 'error' 120 'edit-tags', 'view', 'login', 'error', 'about'
116 ); 121 );
117 122
118 return (in_array($view, $views) ? $view . '.twig' : 'home.twig'); 123 return (in_array($view, $views) ? $view . '.twig' : 'home.twig');
@@ -295,21 +300,6 @@ final class Tools
295 } 300 }
296 301
297 /** 302 /**
298 * Download the sqlite database
299 */
300 public static function downloadDb()
301 {
302 header('Content-Disposition: attachment; filename="poche.sqlite.gz"');
303 self::_status(200);
304
305 header('Content-Transfer-Encoding: binary');
306 header('Content-Type: application/octet-stream');
307 echo gzencode(file_get_contents(STORAGE_SQLITE));
308
309 exit;
310 }
311
312 /**
313 * Get the content for a given URL (by a call to FullTextFeed) 303 * Get the content for a given URL (by a call to FullTextFeed)
314 * 304 *
315 * @param Url $url 305 * @param Url $url