Page MenuHomePhabricator

Script-URL generation breaks up when using https
Closed, ResolvedPublic

Description

Author: joerg

Description:
Wikimedia is installed on a virtual host with SSL enabled: https://wiki.server.com.
This works fine so far, but when clicking on Save after editing an article, the server returns a "Invalid
request" and the scheme shows "http" instead of "https" (however the article is saved and putting an "s"
behind the http helps to continue).
The problem seems to be the $_SERVER['HTTPS'] check in DefaultSettings.php which apparently doesn't work
(we're running Apache 2.0.52 and PHP 4.3.10 on Gentoo Linux). After some changes (see below) it works fine
now by using the port as criterium for https detection (s. code).
Also I added the prefix $wgServer in the line

$wgScriptPath = $wgServer . '/wiki';

because it was missing.

Changes in DefaultSettings.php:

check if server use https:

if ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')

|| (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT']==443)) {    
      $wgProto = 'https';

} else {

$wgProto = 'http';

}

  1. original statement
  2. $wgProto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';

Version: 1.3.x
Severity: normal
OS: Linux
Platform: PC

Details

Reference
bz1573
TitleReferenceAuthorSource BranchDest Branch
ldap: escape cn values when searchingtoolforge-repos/gitlab-account-approval!13bd808work/bd808/escape-ldap-search-inputmain
Customize query in GitLab

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:12 PM
bzimport set Reference to bz1573.
bzimport added a subscriber: Unknown Object (MLST).

acanon wrote:

That works for me too, except that I have to use the string "ON" (capitalized)
for comparison, as that's what my PHP engine provides.

Works with 1.6alpha, should work with 1.5 series too

Diffusion added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:22 AM