added an http / https switch

This commit is contained in:
Sebastian Kalicki 2018-10-02 00:10:55 +02:00 committed by GitHub
parent 755907d117
commit c6c9ce8fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,8 @@ use SilverStripe\View\Parsers\ShortcodeParser;
ShortcodeParser::get('default')->register('googlemap', function($arguments, $address, $parser, $shortcode) {
$iframeUrl = sprintf(
'http://maps.google.com/maps?q=%s&hnear=%s&ie=UTF8&hq=&t=m&z=14&output=embed',
'%s://maps.google.com/maps?q=%s&hnear=%s&ie=UTF8&hq=&t=m&z=14&output=embed',
(isset($_SERVER['HTTPS'])) ? 'https': 'http',
urlencode($address),
urlencode($address)
);