From: laury Date: Fri, 22 Jul 2016 17:09:45 +0000 (-0400) Subject: Video code now respects http:// or lack thereof, adding if necessary X-Git-Tag: v2.3.0^2~1^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=a5189cce43b81ff834d799b58a957dd041eb030e;p=WP-Plugins%2Fglm-member-db.git Video code now respects or lack thereof, adding if necessary --- diff --git a/models/admin/management/videos.php b/models/admin/management/videos.php index cc06d80b..8dd48f8d 100644 --- a/models/admin/management/videos.php +++ b/models/admin/management/videos.php @@ -55,6 +55,12 @@ class GlmMembersAdmin_management_videos $this->config = $config; } + + public function addScheme($url, $scheme = 'http://') + { + return parse_url($url, PHP_URL_SCHEME) === null ? + $scheme . $url : $url; + } /* * Perform Model Action @@ -113,9 +119,11 @@ class GlmMembersAdmin_management_videos if (isset($_REQUEST['option']) && $_REQUEST['option'] != '') { $option = $_REQUEST['option']; } + switch($option) { case 'transfer_videos': + $resultMessage = '
$_REQUEST: ' . print_r($_REQUEST, true) . '
'; $sql = " SELECT id,descr,video_url @@ -133,8 +141,10 @@ class GlmMembersAdmin_management_videos // match 0 is the whole iframe $iframeCode = $matches[0]; // from the first matched element get the src attribute + echo "TEST". $this->addScheme($srcMatches[0])."TESTEND"; if ( preg_match( '%youtube.com/embed/([^?"]*)%', $matches[1], $srcMatches ) ) { echo '
$srcMatches: ' . print_r($srcMatches, true) . '
'; + } $sqlUpdate = " UPDATE " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_info diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 23a750ae..1e86d66c 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -105,12 +105,5 @@ if(!empty($locations)) // } //} -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