Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-projects commit in forums/htdocs/includes: functions.php
Date: Mon, 24 Nov 2008 06:14:26
Message-Id: E1L4UiF-0006Iu-G8@stork.gentoo.org
1 robbat2 08/11/24 06:14:23
2
3 Modified: functions.php
4 Log:
5 Document the HTTP_FRONT_END_HTTPS trick for the next fool to wonder around the codebase.
6
7 Revision Changes Path
8 1.25 forums/htdocs/includes/functions.php
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/forums/htdocs/includes/functions.php?rev=1.25&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/forums/htdocs/includes/functions.php?rev=1.25&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/forums/htdocs/includes/functions.php?r1=1.24&r2=1.25
13
14 Index: functions.php
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-projects/forums/htdocs/includes/functions.php,v
17 retrieving revision 1.24
18 retrieving revision 1.25
19 diff -p -w -b -B -u -u -r1.24 -r1.25
20 --- functions.php 24 Nov 2008 06:09:44 -0000 1.24
21 +++ functions.php 24 Nov 2008 06:14:23 -0000 1.25
22 @@ -7,7 +7,7 @@
23 * copyright : (C) 2001 The phpBB Group
24 * email : support@×××××.com
25 *
26 - * $Id: functions.php,v 1.24 2008/11/24 06:09:44 robbat2 Exp $
27 + * $Id: functions.php,v 1.25 2008/11/24 06:14:23 robbat2 Exp $
28 *
29 *
30 ***************************************************************************/
31 @@ -1066,7 +1066,13 @@ function redirect($url)
32 message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.');
33 }
34
35 - $server_protocol = (isset($_SERVER['HTTPS']) || isset($_SERVER["HTTP_FRONT_END_HTTPS"]) || $board_config['cookie_secure']) ? 'https://' : 'http://';
36 + // If running phpBB on Apache behind a Squid reverse proxy that provides
37 + // the HTTPS, you need to use "cache_peer ... front-end-https" in Squid,
38 + // as well as check the HTTP_FRONT_END_HTTPS variable inside PHP to
39 + // safely detect HTTPS.
40 + // robbat2@g.o <November 23, 2008>
41 + $server_secure = isset($_SERVER['HTTPS']) || isset($_SERVER["HTTP_FRONT_END_HTTPS"]) || $board_config['cookie_secure'];
42 + $server_protocol = ($server_secure) ? 'https://' : 'http://';
43 $server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name']));
44 $server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : '';
45 $script_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path']));