summaryrefslogtreecommitdiff
path: root/lib/action.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-10-14 14:22:49 -0400
committerEvan Prodromou <evan@status.net>2010-10-14 14:22:49 -0400
commit72454db118ab4e54ba2d24a1cbd0e85da2a8413b (patch)
tree32d7836c31172f5143de96f839ed7c83a666bc86 /lib/action.php
parentb31c49c5d47e04c59bbbcf878ffd307fbf60b533 (diff)
make the logo be compatible with HTTPS pages, if possible
Diffstat (limited to 'lib/action.php')
-rw-r--r--lib/action.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/action.php b/lib/action.php
index fcac0e0a7..55ee83bde 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -426,11 +426,35 @@ class Action extends HTMLOutputter // lawsuit
}
$this->elementStart('a', array('class' => 'url home bookmark',
'href' => $url));
- if (common_config('site', 'logo') || file_exists(Theme::file('logo.png'))) {
+
+ if (StatusNet::isHTTPS()) {
+ $logoUrl = common_config('site', 'ssllogo');
+ if (empty($logoUrl)) {
+ // if logo is an uploaded file, try to fall back to HTTPS file URL
+ $httpUrl = common_config('site', 'logo');
+ if (!empty($httpUrl)) {
+ $f = File::staticGet('url', $httpUrl);
+ if (!empty($f) && !empty($f->filename)) {
+ // this will handle the HTTPS case
+ $logoUrl = File::url($f->filename);
+ }
+ }
+ }
+ } else {
+ $logoUrl = common_config('site', 'logo');
+ }
+
+ if (empty($logoUrl) && file_exists(Theme::file('logo.png'))) {
+ // This should handle the HTTPS case internally
+ $logoUrl = Theme::path('logo.png');
+ }
+
+ if (!empty($logoUrl)) {
$this->element('img', array('class' => 'logo photo',
- 'src' => (common_config('site', 'logo')) ? common_config('site', 'logo') : Theme::path('logo.png'),
+ 'src' => $logoUrl,
'alt' => common_config('site', 'name')));
}
+
$this->text(' ');
$this->element('span', array('class' => 'fn org'), common_config('site', 'name'));
$this->elementEnd('a');