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:
parent
56d1c9b06a
commit
6f347b445d
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user