let files go to SSL dir too
This commit is contained in:
parent
3018683718
commit
31461e120f
2
README
2
README
|
@ -1462,6 +1462,8 @@ server: server name to use when creating URLs for uploaded files.
|
||||||
a virtual server here can speed up Web performance.
|
a virtual server here can speed up Web performance.
|
||||||
path: URL path, relative to the server, to find files. Defaults to
|
path: URL path, relative to the server, to find files. Defaults to
|
||||||
main path + '/file/'.
|
main path + '/file/'.
|
||||||
|
ssl: whether to use HTTPS for file URLs. Defaults to null, meaning to
|
||||||
|
guess based on other SSL settings.
|
||||||
filecommand: command to use for determining the type of a file. May be
|
filecommand: command to use for determining the type of a file. May be
|
||||||
skipped if fileinfo extension is installed. Defaults to
|
skipped if fileinfo extension is installed. Defaults to
|
||||||
'/usr/bin/file'.
|
'/usr/bin/file'.
|
||||||
|
|
|
@ -228,9 +228,20 @@ class File extends Memcached_DataObject
|
||||||
$server = common_config('site', 'server');
|
$server = common_config('site', 'server');
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: protocol
|
$ssl = common_config('attachments', 'ssl');
|
||||||
|
|
||||||
return 'http://'.$server.$path.$filename;
|
if (is_null($ssl)) { // null -> guess
|
||||||
|
if (common_config('site', 'ssl') == 'always' &&
|
||||||
|
!common_config('attachments', 'server')) {
|
||||||
|
$ssl = true;
|
||||||
|
} else {
|
||||||
|
$ssl = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$protocol = ($ssl) ? 'https' : 'http';
|
||||||
|
|
||||||
|
return $protocol.'://'.$server.$path.$filename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -188,6 +188,7 @@ $default =
|
||||||
array('server' => null,
|
array('server' => null,
|
||||||
'dir' => INSTALLDIR . '/file/',
|
'dir' => INSTALLDIR . '/file/',
|
||||||
'path' => $_path . '/file/',
|
'path' => $_path . '/file/',
|
||||||
|
'ssl' => null,
|
||||||
'supported' => array('image/png',
|
'supported' => array('image/png',
|
||||||
'image/jpeg',
|
'image/jpeg',
|
||||||
'image/gif',
|
'image/gif',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user