Skip to content

Commit

Permalink
Merge pull request #74 from dshanske/ssl
Browse files Browse the repository at this point in the history
Rewrite local links to SSL
  • Loading branch information
pfefferle committed Jun 28, 2018
2 parents d112d62 + d2c254c commit 5272d61
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ function get_user_by_identifier( $identifier ) {
}
// Ensure has trailing slash
$identifier = trailingslashit( $identifier );
if ( ( 'https' === wp_parse_url( home_url(), PHP_URL_SCHEME ) ) && ( wp_parse_url( home_url(), PHP_URL_HOST ) === wp_parse_url( $identifier, PHP_URL_HOST ) ) ) {
$identifier = set_url_scheme( $identifier, 'https' );
}
// Try to save the expense of a search query if the URL is the site URL
if ( home_url( '/' ) === $identifier ) {
// Use the Indieweb settings to set the default author
Expand Down
5 changes: 4 additions & 1 deletion indieauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: IndieAuth
* Plugin URI: https://github.com/indieweb/wordpress-indieauth/
* Description: Login to your site using IndieAuth.com
* Version: 3.0.1
* Version: 3.0.2
* Author: IndieWebCamp WordPress Outreach Club
* Author URI: https://indieweb.org/WordPress_Outreach_Club
* License: MIT
Expand Down Expand Up @@ -53,6 +53,9 @@ public function __construct() {
}

public function pre_user_url( $user_url ) {
if ( 'https' === wp_parse_url( home_url(), PHP_URL_SCHEME ) && ( wp_parse_url( $user_url, PHP_URL_HOST ) === wp_parse_url( home_url(), PHP_URL_HOST ) ) ) {
$user_url = set_url_scheme( $user_url, 'https' );
}
return trailingslashit( $user_url );
}
}
Expand Down
4 changes: 2 additions & 2 deletions languages/indieauth.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This file is distributed under the MIT.
msgid ""
msgstr ""
"Project-Id-Version: IndieAuth 3.0.1\n"
"Project-Id-Version: IndieAuth 3.0.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/indieauth\n"
"POT-Creation-Date: 2018-06-16 14:53:09+00:00\n"
"POT-Creation-Date: 2018-06-27 22:28:49+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Tags:** IndieAuth, IndieWeb, IndieWebCamp, login
**Requires at least:** 4.7
**Tested up to:** 4.9.6
**Stable tag:** 3.0.1
**Stable tag:** 3.0.2
**License:** MIT
**License URI:** http://opensource.org/licenses/MIT
**Donate link:** https://opencollective.com/indieweb
Expand Down Expand Up @@ -87,6 +87,9 @@ endpoint for WordPress. If you wish to use Indieauth.com or another endpoint, yo

## Changelog ##

### 3.0.2 ###
* Automatically rewrite local URLs to https if the local site is site to SSL

### 3.0.1 ###
* In previous version fixed issue where error message was not returned if there was a missing bearer token. This was needed due fact that some servers filter tokens. However, this meant that it would do this for all API requests, even ones not requiring authentication such as webmentions. Reverted change with flag
* Added constant `INDIEAUTH_TOKEN_ERROR` which if set to true will return an error if it cannot find a token.
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: indieweb, pfefferle, dshanske
Tags: IndieAuth, IndieWeb, IndieWebCamp, login
Requires at least: 4.7
Tested up to: 4.9.6
Stable tag: 3.0.1
Stable tag: 3.0.2
License: MIT
License URI: http://opensource.org/licenses/MIT
Donate link: https://opencollective.com/indieweb
Expand Down Expand Up @@ -87,6 +87,9 @@ endpoint for WordPress. If you wish to use Indieauth.com or another endpoint, yo

== Changelog ==

= 3.0.2 =
* Automatically rewrite local URLs to https if the local site is site to SSL

= 3.0.1 =
* In previous version fixed issue where error message was not returned if there was a missing bearer token. This was needed due fact that some servers filter tokens. However, this meant that it would do this for all API requests, even ones not requiring authentication such as webmentions. Reverted change with flag
* Added constant `INDIEAUTH_TOKEN_ERROR` which if set to true will return an error if it cannot find a token.
Expand Down

0 comments on commit 5272d61

Please sign in to comment.