Opened 17 years ago
Closed 16 years ago
#11885 closed defect (bug) (fixed)
HTTPS check does not work on 1&1 servers in canonical.php.
| Reported by: | d4manek | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.0 |
| Component: | Canonical | Version: | 2.9.1 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
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
@
16 years ago
- Component General → Canonical
- Milestone Unassigned → 3.0
Looks like a good patch to me. Let's get it in line for test & commit.
#4
@
16 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().
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.