forked from GNUsocial/gnu-social
try and show an SSL image for the creative commons image
This commit is contained in:
parent
cef10c7167
commit
40c64388e6
@ -894,8 +894,26 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
case 'cc': // fall through
|
case 'cc': // fall through
|
||||||
default:
|
default:
|
||||||
$this->elementStart('p');
|
$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',
|
$this->element('img', array('id' => 'license_cc',
|
||||||
'src' => common_config('license', 'image'),
|
'src' => $url,
|
||||||
'alt' => common_config('license', 'title'),
|
'alt' => common_config('license', 'title'),
|
||||||
'width' => '80',
|
'width' => '80',
|
||||||
'height' => '15'));
|
'height' => '15'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user