From c6c9ce8fbf8a268ca2ad8851b6714dbc75081236 Mon Sep 17 00:00:00 2001 From: Sebastian Kalicki Date: Tue, 2 Oct 2018 00:10:55 +0200 Subject: [PATCH 1/2] added an http / https switch --- .../05_Extending/How_Tos/02_Create_a_Google_Maps_Shortcode.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/en/02_Developer_Guides/05_Extending/How_Tos/02_Create_a_Google_Maps_Shortcode.md b/docs/en/02_Developer_Guides/05_Extending/How_Tos/02_Create_a_Google_Maps_Shortcode.md index 2d6f0b38c..dd9dd54a4 100644 --- a/docs/en/02_Developer_Guides/05_Extending/How_Tos/02_Create_a_Google_Maps_Shortcode.md +++ b/docs/en/02_Developer_Guides/05_Extending/How_Tos/02_Create_a_Google_Maps_Shortcode.md @@ -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) ); From 9051fb923d7640ef7728aad3e40a62c1c5ef566a Mon Sep 17 00:00:00 2001 From: Sebastian Kalicki Date: Tue, 2 Oct 2018 05:19:27 +0200 Subject: [PATCH 2/2] removed http... --- .../05_Extending/How_Tos/02_Create_a_Google_Maps_Shortcode.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/en/02_Developer_Guides/05_Extending/How_Tos/02_Create_a_Google_Maps_Shortcode.md b/docs/en/02_Developer_Guides/05_Extending/How_Tos/02_Create_a_Google_Maps_Shortcode.md index dd9dd54a4..a8c452dc9 100644 --- a/docs/en/02_Developer_Guides/05_Extending/How_Tos/02_Create_a_Google_Maps_Shortcode.md +++ b/docs/en/02_Developer_Guides/05_Extending/How_Tos/02_Create_a_Google_Maps_Shortcode.md @@ -20,8 +20,7 @@ use SilverStripe\View\Parsers\ShortcodeParser; ShortcodeParser::get('default')->register('googlemap', function($arguments, $address, $parser, $shortcode) { $iframeUrl = sprintf( - '%s://maps.google.com/maps?q=%s&hnear=%s&ie=UTF8&hq=&t=m&z=14&output=embed', - (isset($_SERVER['HTTPS'])) ? 'https': 'http', + '//maps.google.com/maps?q=%s&hnear=%s&ie=UTF8&hq=&t=m&z=14&output=embed', urlencode($address), urlencode($address) );