diff --git a/modules/embed_videos/controllers/embedded_videos.php b/modules/embed_videos/controllers/embedded_videos.php index 83077e59..256ad7c2 100644 --- a/modules/embed_videos/controllers/embedded_videos.php +++ b/modules/embed_videos/controllers/embedded_videos.php @@ -52,11 +52,13 @@ class Embedded_videos_Controller extends Controller { if ($content) { $valid_url = true; $sxml = simplexml_load_file("http://gdata.youtube.com/feeds/api/videos/$video_id"); - if ($title == '') { - $title = (string)$sxml->title; - } - if ($description == '') { - $description = (string)$sxml->content; + if ($sxml) { + if ($title == '') { + $title = (string)$sxml->title; + } + if ($description == '') { + $description = (string)$sxml->content; + } } } } @@ -76,7 +78,6 @@ class Embedded_videos_Controller extends Controller { $item->slug = $form->add_embedded_video->inputs['slug']->value; $path_info = @pathinfo($temp_filename); $item->save(); - //db::query("UPDATE {items} SET `type` = 'embedded_video' WHERE `id` = $item->id")->execute(); $embedded_video->item_id = $item->id; $embedded_video->validate(); $embedded_video->save(); diff --git a/modules/embed_videos/helpers/embed_videos.php b/modules/embed_videos/helpers/embed_videos.php index 49182407..75b47ec2 100644 --- a/modules/embed_videos/helpers/embed_videos.php +++ b/modules/embed_videos/helpers/embed_videos.php @@ -35,9 +35,8 @@ class embed_videos_Core { $group->input("video_url")->label(t("Video URL")) ->error_messages( "conflict", t("There is already a movie with this ID")) - ->error_messages("required", t("You must provide a Youtube ID")) - ->error_messages("length", t("Invalid Youtube ID")) - ->error_messages("invalid_id", t("Invalid Youtube ID")); + ->error_messages("required", t("You must provide a URL")) + ->error_messages("invalid_id", t("Invalid URL")); $group->textarea("description")->label(t("Description")); $group->input("slug")->label(t("Internet Address")) ->error_messages(