fixes for quitter.se https setup

This commit is contained in:
Hannes Mannerheim 2015-12-29 16:35:09 +01:00
parent ebaee73b03
commit f0786ee8fe
2 changed files with 3 additions and 9 deletions

View File

@ -88,7 +88,6 @@ class QvitterAction extends ApiAction
$instanceurl = common_path('', StatusNet::isHTTPS());
common_set_returnto(''); // forget this
// if this is a profile we add a link header for LRDD Discovery (see WebfingerPlugin.php)
@ -201,9 +200,10 @@ class QvitterAction extends ApiAction
window.thisSiteThinksItIsHttpButIsActuallyHttps = <?php
// this is due to a crazy setup at quitter.se, sorry about that
if(isset($_SERVER['HTTPS'])
$siteSSL = common_config('site', 'ssl');
if(isset($_SERVER['HTTPS'])
&& $_SERVER['HTTPS'] != 'off'
&& substr($instanceurl,0,7) == 'http://') {
&& $siteSSL == 'never' ) {
$this_site_thinks_it_is_http_but_is_actually_https = true;
print 'true';
}

View File

@ -3731,12 +3731,6 @@ function uploadAttachment(e, thisUploadButton) {
var mediaurl = rsp.find('mediaurl').text();
// if this site is like quitter.se, we have to do this, otherwise
// gnusocial will not recognize the link to the image as a local attachment
if(window.thisSiteThinksItIsHttpButIsActuallyHttps) {
mediaurl = mediaurl.replace('https://','http://');
}
$('img.to-upload').attr('data-shorturl', mediaurl);
$('img.to-upload').addClass('uploaded');
$('img.to-upload').removeClass('to-upload');