Merge lp:~leeturner/quam-plures/server_port_fix into lp:quam-plures

Proposed by Lee Turner
Status: Merged
Merged at revision: 7614
Proposed branch: lp:~leeturner/quam-plures/server_port_fix
Merge into: lp:quam-plures
Diff against target: 12 lines (+1/-1)
1 file modified
qp_install/index.php (+1/-1)
To merge this branch: bzr merge lp:~leeturner/quam-plures/server_port_fix
Reviewer Review Type Date Requested Status
Tilman Blumenbach (community) Approve
EdB Approve
Review via email: mp+72879@code.launchpad.net

Description of the change

See this thread for details:

http://forums.quamplures.net/viewtopic.php?f=16&t=826

My dev machine is set up to use port 8888 and the installer gets it wrong when it is trying to guess the base url. It basically doesn't take into account that the HTTP_HOST variable can also include the port so it adds it twice.

This branch adds a check for the port before trying to add it again.

To post a comment you must log in.
Revision history for this message
EdB (edb) wrote :

I have no idea if this solution can cause a problem down the road for some other reasonable and realistic situation, and I don't care :) Solves a problem now + doesn't cause any now = approved!

Will merge after an appropriate delay to allow others to do code review and testing.

review: Approve
Revision history for this message
Tilman Blumenbach (tblue) wrote :

Looks fine!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qp_install/index.php'
2--- qp_install/index.php 2011-02-07 05:27:47 +0000
3+++ qp_install/index.php 2011-08-25 12:54:36 +0000
4@@ -387,7 +387,7 @@
5 param( 'conf_db_tableprefix', 'string', $app_db_tableprefix );
6 // Guess baseurl:
7 $app_baseurl = 'http://'.( isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : 'yourserver.com' );
8- if( isset( $_SERVER['SERVER_PORT'] ) && ( $_SERVER['SERVER_PORT'] != '80' ) )
9+ if( isset( $_SERVER['SERVER_PORT'] ) && ( $_SERVER['SERVER_PORT'] != '80' ) && (strpos($app_baseurl,':') === false) )
10 $app_baseurl .= ':'.$_SERVER['SERVER_PORT'];
11 $app_baseurl .= preg_replace( '#/qp_install(/(index.php)?)?$#', '', $ReqPath ).'/';
12 param( 'conf_baseurl', 'string', $app_baseurl );

Subscribers

People subscribed via source and target branches