[fix] Attachment urls don't seems to be local if using different server in config
This commit is contained in:
parent
c09da94eda
commit
15b9a3b8ca
|
@ -84,7 +84,15 @@ class QvitterAction extends ApiAction
|
|||
$siterootdomain = common_config('site','server');
|
||||
$qvitterpath = Plugin::staticPath('Qvitter', '');
|
||||
$apiroot = common_path('api/', StatusNet::isHTTPS());
|
||||
$attachmentroot = common_path('attachment/', 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());
|
||||
}
|
||||
$instanceurl = common_path('', StatusNet::isHTTPS());
|
||||
$favicon_path = QvitterPlugin::settings("favicon_path");
|
||||
|
||||
|
|
|
@ -730,7 +730,12 @@ function isLocalURL(url) {
|
|||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
if(url.substring(0,window.siteAttachmentURLBase.length) == window.siteAttachmentURLBase) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user