diff options
author | Evan Prodromou <evan@status.net> | 2010-02-11 17:06:57 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-02-11 17:06:57 -0500 |
commit | 31461e120f23416c8c4979805900e3018fb2a6fd (patch) | |
tree | 84e6d7c4aea1e25e601b8ebbdb2810aee0f3cfdc /classes | |
parent | 3018683718bd73bf00472622f9e81914703d50a7 (diff) |
let files go to SSL dir too
Diffstat (limited to 'classes')
-rw-r--r-- | classes/File.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/classes/File.php b/classes/File.php index ee418a802..91b12d2e2 100644 --- a/classes/File.php +++ b/classes/File.php @@ -228,9 +228,20 @@ class File extends Memcached_DataObject $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; } } |