let avatars be served over SSL
This commit is contained in:
parent
5175b5062e
commit
d6869cde7b
2
README
2
README
|
@ -1192,6 +1192,8 @@ server: If set, defines another server where avatars are stored in the
|
|||
typically only make 2 connections to a single server at a
|
||||
time <http://ur1.ca/6ih>, so this can parallelize the job.
|
||||
Defaults to null.
|
||||
ssl: Whether to access avatars using HTTPS. Defaults to null, meaning
|
||||
to guess based on site-wide SSL settings.
|
||||
|
||||
public
|
||||
------
|
||||
|
|
|
@ -82,9 +82,20 @@ class Avatar extends Memcached_DataObject
|
|||
$server = common_config('site', 'server');
|
||||
}
|
||||
|
||||
// XXX: protocol
|
||||
$ssl = common_config('avatar', 'ssl');
|
||||
|
||||
return 'http://'.$server.$path.$filename;
|
||||
if (is_null($ssl)) { // null -> guess
|
||||
if (common_config('site', 'ssl') == 'always' &&
|
||||
!common_config('avatar', 'server')) {
|
||||
$ssl = true;
|
||||
} else {
|
||||
$ssl = false;
|
||||
}
|
||||
}
|
||||
|
||||
$protocol = ($ssl) ? 'https' : 'http';
|
||||
|
||||
return $protocol.'://'.$server.$path.$filename;
|
||||
}
|
||||
|
||||
function displayUrl()
|
||||
|
|
|
@ -111,7 +111,8 @@ $default =
|
|||
'avatar' =>
|
||||
array('server' => null,
|
||||
'dir' => INSTALLDIR . '/avatar/',
|
||||
'path' => $_path . '/avatar/'),
|
||||
'path' => $_path . '/avatar/',
|
||||
'ssl' => null),
|
||||
'background' =>
|
||||
array('server' => null,
|
||||
'dir' => INSTALLDIR . '/background/',
|
||||
|
|
Loading…
Reference in New Issue
Block a user