Kitchin,
I really didn’t want to spend time doing this, but I thought it appropriate.
$url_path = str_replace(parse_url($this->https_url, PHP_URL_PATH), '', $url_path); // wrong, https_url already stripped of path
The path in the https_url is being stripped from the path found by the regular expression. Not https_url itself. The entire block you commented out works fine.
if ($url_path == '/') { // wrong, external links can match this
That doesn’t matter because the code that changes the link to HTTPS is this:
$buffer = str_replace($html, str_replace($this->http_url, $this->https_url, $html), $buffer);
Which obviously will not affect external URL’s.
$force_ssl_admin= defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN && is_admin(); // new code
Why would you want to force every link to a post/page in the admin panel to be HTTPS regardless of what the user selected just because they’re forcing their admin panel to be HTTPS? The idea is for the link changing to be intelligent and only change links to HTTPS that have been forced to do so.
I’m not really sure where you were going with any of your changes other than the one line that suppresses the error, which I will implement in the next update. If the code does not appear to be working for you, please create a topic with specific examples of it not working so that I can review the ‘buggyness’ in action.
Thanks,
Mike