Merge branch 'fix84_attachmenturl' into 'master'
[fix] Attachment urls don't seems to be local if using different server in config See merge request !83
This commit is contained in:
commit
65c18a252c
|
@ -84,7 +84,15 @@ class QvitterAction extends ApiAction
|
||||||
$siterootdomain = common_config('site','server');
|
$siterootdomain = common_config('site','server');
|
||||||
$qvitterpath = Plugin::staticPath('Qvitter', '');
|
$qvitterpath = Plugin::staticPath('Qvitter', '');
|
||||||
$apiroot = common_path('api/', StatusNet::isHTTPS());
|
$apiroot = common_path('api/', StatusNet::isHTTPS());
|
||||||
|
|
||||||
|
$attachmentconfig=common_config('attachments');
|
||||||
|
if(StatusNet::isHTTPS() && $attachmentconfig['sslserver']){
|
||||||
|
$attachmentroot ='https://'.$attachmentconfig['sslserver'].$attachmentconfig['path'];
|
||||||
|
} elseif(!StatusNet::isHTTPS() && $attachmentconfig['server']) {
|
||||||
|
$attachmentroot ='http://'.$attachmentconfig['server'].$attachmentconfig['path'];
|
||||||
|
} else {
|
||||||
$attachmentroot = common_path('attachment/', StatusNet::isHTTPS());
|
$attachmentroot = common_path('attachment/', StatusNet::isHTTPS());
|
||||||
|
}
|
||||||
$instanceurl = common_path('', StatusNet::isHTTPS());
|
$instanceurl = common_path('', StatusNet::isHTTPS());
|
||||||
$favicon_path = QvitterPlugin::settings("favicon_path");
|
$favicon_path = QvitterPlugin::settings("favicon_path");
|
||||||
|
|
||||||
|
|
|
@ -729,10 +729,15 @@ function isLocalURL(url) {
|
||||||
if(url.substring(0,window.siteInstanceURL.length) == window.siteInstanceURL) {
|
if(url.substring(0,window.siteInstanceURL.length) == window.siteInstanceURL) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if(url.substring(0,window.siteAttachmentURLBase.length) == window.siteAttachmentURLBase) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ·
|
/* ·
|
||||||
|
|
Loading…
Reference in New Issue
Block a user