}
$sqlUpdate = "
UPDATE " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_info
- SET video_url='" . $srcMatches[0] . "'
+ SET video_url='" . $this->addScheme($srcMatches[0]) . "'
WHERE id='" . $member['id'] . "'";
$this->wpdb->query($sqlUpdate);
// Create embed code based on video type. Parse the url for the proper code.
// - 1 = youtube
// - 2 = vimeo
- $video_url = $memberData['video_url'];
+ $video_url = $this->addScheme($memberData['video_url']);
if (strpos($video_url, 'youtube') !== false) {
if (strpos($video_url, 'embed') !== false) {
// ));
// }
//}
+
+if (!function_exists('addScheme')) {
+ function addScheme($url, $scheme = 'http://')
+ {
+ return parse_url($url, PHP_URL_SCHEME) === null ?
+ $scheme . $url : $url;
+ }
+}
?>
\ No newline at end of file