Validaciones para evitar que se metan urls de videos no válidos

git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@152 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
This commit is contained in:
David Arranz 2012-08-29 19:15:40 +00:00
parent 56d1c9b06a
commit 6f347b445d
2 changed files with 7 additions and 1 deletions

View File

@ -77,6 +77,10 @@ function bp_dedication_create_new_dedication() {
$videoData = array();
if ((!isYoutubeVideo($video_url)) && (!isVimeoVideo($video_url))) {
return false;
}
if (isYoutubeVideo($video_url)) {
$videoID = getYouTubeVideoID($video_url);
@ -182,6 +186,8 @@ function bp_dedication_create_new_dedication() {
do_action( 'bp_dedication_create_new_dedication', $post_id, $friend_email, $bp->loggedin_user->id);
return true;
} else {
return false;
}
}

View File

@ -102,7 +102,7 @@ function bp_dedication_new_dedication() {
bp_core_add_message( __( 'Your dedication was created!', 'bp-dedication' ) );
bp_core_redirect( bp_loggedin_user_domain() . bp_get_dedication_slug());
} else {
bp_core_add_message( __( 'Error. Your dedication not was created!', 'bp-dedication' ) );
}
}