Forums | Mahara Community

Support /
HTTPS Logins


Gordon McLeod's profile picture
Posts: 197

30 May 2014, 1:35

Hi Aaron,

With a slight tweak your script fixed the issue. Obviously this wouldn't help if the videos are hosted on a site that doesn't support https - but for YouTube it solved the problem perfectly. I've included the amended script below for future reference.

Regards, Gordon.

 

<?php

define('INTERNAL', 1);

require_once(dirname(__FILE__) . '/init.php');

 

$records = get_records_array('block_instance', 'blocktype', 'externalvideo', 'id', 'id, configdata');

foreach ($records as $r) {

    $data = unserialize($r->configdata);

    $data['html'] = str_replace('http://', 'https://', $data['html']);

    $data['videoid'] = str_replace('http://', 'https://', $data['videoid']);

    $serdata = serialize($data);

    set_field('block_instance', 'configdata', $serdata, 'id', $r->id);

}

?>

21 results