Skip to content

Commit defc016

Browse files
author
Jim Kirkpatrick
committed
YouTube over HTTPS, #609
1 parent 9c0f6d0 commit defc016

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

template.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function phptemplate_preprocess_block(&$vars, $hook) {
145145
$vars['classes'] = implode(' ', $classes);
146146

147147
if (user_access('administer blocks')) { // Block Edit Link
148-
$vars['edit_block'] = l(theme_image(path_to_theme() .'/images/edit.png', 'Edit Block', 'Edit Block'), 'admin/build/block/configure/'. $block->module .'/'. $block->delta, array('query' => drupal_get_destination(), 'html' => TRUE));
148+
$vars['edit_block'] = l(theme_image(path_to_theme() .'/images/edit.png', 'Edit Block', 'Edit Block'), 'admin/build/block/configure/'. $block->module .'/'. $block->delta, array('query' => drupal_get_destination(), 'html' => TRUE));
149149
}
150150
}
151151

@@ -698,9 +698,9 @@ function transition2_menu_item_link($link) {
698698
* Adds jquery for the What Why How Where menu
699699
*/
700700
function transition2_preprocess_page(&$vars) {
701-
jquery_ui_add('ui.accordion');
702-
$path_js = drupal_get_path('theme', 'transition2').'/js/';
703-
drupal_add_js($path_js.'wwhw_menu.js');
701+
jquery_ui_add('ui.accordion');
702+
$path_js = drupal_get_path('theme', 'transition2').'/js/';
703+
drupal_add_js($path_js.'wwhw_menu.js');
704704

705705
}
706706

@@ -726,3 +726,15 @@ function transition2_imagecache_formatter_featured_image_default($element) {
726726
return theme('imagecache', $presetname, $item['filepath'], $item['data']['alt'], $item['data']['title'], array('class' => $class));
727727
}
728728

729+
/**
730+
* Make YouTube links use HTTPS on HTTPS connetions.
731+
*
732+
* @see https://drupal.org/node/110046
733+
*/
734+
function transition2_preprocess_media_youtube_default_external(&$variables) {
735+
$ssl = (!empty($_SERVER['HTTPS']));
736+
if ($ssl) {
737+
$variables['url'] = preg_replace('/^http:/', 'https:', $variables['url']);
738+
$variables['thumbnail'] = preg_replace('/src="http:/', 'src="https:', $variables['thumbnail']);
739+
}
740+
}

0 commit comments

Comments
 (0)