fixes for quitter.se https setup
This commit is contained in:
parent
ebaee73b03
commit
f0786ee8fe
|
@ -88,7 +88,6 @@ class QvitterAction extends ApiAction
|
||||||
$instanceurl = common_path('', StatusNet::isHTTPS());
|
$instanceurl = common_path('', StatusNet::isHTTPS());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
common_set_returnto(''); // forget this
|
common_set_returnto(''); // forget this
|
||||||
|
|
||||||
// if this is a profile we add a link header for LRDD Discovery (see WebfingerPlugin.php)
|
// 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
|
window.thisSiteThinksItIsHttpButIsActuallyHttps = <?php
|
||||||
|
|
||||||
// this is due to a crazy setup at quitter.se, sorry about that
|
// 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'
|
&& $_SERVER['HTTPS'] != 'off'
|
||||||
&& substr($instanceurl,0,7) == 'http://') {
|
&& $siteSSL == 'never' ) {
|
||||||
$this_site_thinks_it_is_http_but_is_actually_https = true;
|
$this_site_thinks_it_is_http_but_is_actually_https = true;
|
||||||
print 'true';
|
print 'true';
|
||||||
}
|
}
|
||||||
|
|
|
@ -3731,12 +3731,6 @@ function uploadAttachment(e, thisUploadButton) {
|
||||||
|
|
||||||
var mediaurl = rsp.find('mediaurl').text();
|
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').attr('data-shorturl', mediaurl);
|
||||||
$('img.to-upload').addClass('uploaded');
|
$('img.to-upload').addClass('uploaded');
|
||||||
$('img.to-upload').removeClass('to-upload');
|
$('img.to-upload').removeClass('to-upload');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user