Plugin Author
mvied
(@mvied)
Any page that isn’t forced to HTTPS will be set to HTTP with that setting, so it’s doing what it’s supposed to do.
What are you trying to do?
Thread Starter
saas
(@saas)
I am trying to use
Force SSL Exclusively ??? I set it to checked. But It still normalize my https links (which they are as I have set my home url & site url to https).
But in normalizeElements()
you are checking for “ssl_host_diff” value which is hidden value
<input type=”hidden” name=”ssl_host_diff” value=”<?php echo (($this->getPlugin()->getSetting(‘ssl_host_diff’) != 1) ? 0 : 1); ?>” />
So I suppose it should have either be available in settings or Force SSL Exclusively should have been considered to making decision whether to go for http or https????????????
What are your thoughts?
Thread Starter
saas
(@saas)
I have further investigated it & found out your this logic doesn’t make any sense
$this->getPlugin()->makeUrlHttp($url)????????????? why???????????
$matches = array_merge($httpMatches, $httpsMatches);
this gets me all https links
and you are forcing all those to be http???????
Shouldn’t it considered either Force SSL Exclusively ????? if its set to yes then it should not convert to http.
Like if it set to true it should have converted all none http to https
or if false
converted all https to http.
if ($this->getPlugin()->getSetting('exclusive_https')) {
$this->_html = str_replace($url, $this->getPlugin()->makeUrlHttps($url), $this->_html);
} else {
$this->_html = str_replace($url, $this->getPlugin()->makeUrlHttp($url), $this->_html);
}
I modified like this and now I have got partial http & https links (means mix) if I comment the normalize function all of my links are https.
Can you explain the original logic of normalize function so I can be of help????
Thread Starter
saas
(@saas)
The second area where the https links are forced to http
function fixLinksAndForms();
else if ($this->getPlugin()->isUrlLocal($url) && ($post = get_page_by_path($url_parts['path']))) {
$post = $post->ID;
//TODO When logged in to HTTP and visiting an HTTPS page, admin links will always be forced to HTTPS, even if the user is not logged in via HTTPS. I need to find a way to detect this.
}
so both the normalizeElements & fixLinksAndForms are causing issue for me
I modified the normalizeElements as per this code
if ($this->getPlugin()->getSetting('exclusive_https')) {
$this->_html = str_replace($url, $this->getPlugin()->makeUrlHttps($url), $this->_html);
} else {
$this->_html = str_replace($url, $this->getPlugin()->makeUrlHttp($url), $this->_html);
}
but not sure how I can fix the above fixLinksAndForms code????????
I will appreciate if you let me know or I will have to digg more 🙁 I have already spent too much time on this. Hope you have the answer quick.
Thread Starter
saas
(@saas)
😀 Its fixed now. I have get the source from github & upload it and it fixed the issue. And I found you have fixed it a week ago. And its working for me. I will appreciate if you update the wordpress plugins repository as I am sure there will be lots of guys like me having this issue.
Thanks for fixing it.
Kind Regards,
Syed