summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-10-14 00:31:13 -0400
committerEvan Prodromou <evan@status.net>2010-10-14 00:31:13 -0400
commit40c64388e6b0a768dcfa4aa003ba5114be070c2a (patch)
treee32b8ee940157aea99dee8380c3f4c5d08053bc9 /lib
parentcef10c7167dd9c6183b52a09dc9baefbf0b433cc (diff)
try and show an SSL image for the creative commons image
Diffstat (limited to 'lib')
-rw-r--r--lib/action.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/action.php b/lib/action.php
index 008f29d03..b05770b15 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -894,8 +894,26 @@ class Action extends HTMLOutputter // lawsuit
case 'cc': // fall through
default:
$this->elementStart('p');
+
+ $image = common_config('license', 'image');
+ $sslimage = common_config('license', 'sslimage');
+
+ if (StatusNet::isHTTPS()) {
+ if (!empty($sslimage)) {
+ $url = $sslimage;
+ } else if (preg_match('#^http://i.creativecommons.org/#', $image)) {
+ // CC support HTTPS on their images
+ $url = preg_replace('/^http/', 'https', $image);
+ } else {
+ // Better to show mixed content than no content
+ $url = $image;
+ }
+ } else {
+ $url = $image;
+ }
+
$this->element('img', array('id' => 'license_cc',
- 'src' => common_config('license', 'image'),
+ 'src' => $url,
'alt' => common_config('license', 'title'),
'width' => '80',
'height' => '15'));