Opened 13 years ago
Closed 13 years ago
#11885 closed defect (bug) (fixed)
HTTPS check does not work on 1&1 servers in canonical.php.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 2.9.1 |
Component: | Canonical | Keywords: | needs-patch |
Focuses: | Cc: |
Description
In canonical.php, the function redirect_canonical() includes the following line to detect and build an HTTPS url:
$requested_url = ( !empty($_SERVERHTTPS? ) && strtolower($_SERVERHTTPS?) == 'on' ) ? 'https://' : 'http://';
On 1and1.com, this logic does not work because $_SERVERHTTPS? is set to '1' instead of 'on'. It would be better to use the built-in WordPress function is_ssl() in this function, which appears to correctly handle all hosting sites. The fix would look like this:
Attachments (1)
Change History (8)
#3
@
13 years ago
- Component changed from General to Canonical
- Milestone changed from Unassigned to 3.0
Looks like a good patch to me. Let's get it in line for test & commit.
#4
@
13 years ago
I noticed another one of these in wp-app.php the other day. It looks like we also use it in wp_guess_url() and wp-login.php.
Should probably patch them all to use is_ssl().
I put d4manek's solution into patch form. Just for reference: is_ssl(). Looks like the developers tried to standardize this in 2.7.1, e.g. #8641, but this location was missed.