diff --git a/includes/admin/class-bc-templates.php b/includes/admin/class-bc-templates.php index 2210404b..353e9f6a 100644 --- a/includes/admin/class-bc-templates.php +++ b/includes/admin/class-bc-templates.php @@ -685,8 +685,8 @@ class="brightcove-datetime brightcove-end-date" <# } #>
- - + +
@@ -724,14 +724,14 @@ class="brightcove-datetime brightcove-end-date"
<# if ('preview' === data.detailsMode) { #> - + <# } else { #> <# if ( data.images && data.images.thumbnail && data.images.thumbnail.src ) { #> - - + + <# } else { #> - - + + <# } #> <# } #>
diff --git a/includes/class-bc-labels.php b/includes/class-bc-labels.php index be6fcc5d..d48197d0 100644 --- a/includes/class-bc-labels.php +++ b/includes/class-bc-labels.php @@ -137,8 +137,15 @@ public function add_label() { ) { $label_name = sanitize_text_field( $_POST['label-name'] ); $label_path = ! empty( $_POST['label-path'] ) ? $_POST['label-path'] : ''; - $this->cms_api->add_label( $label_name, $label_path ); - wp_safe_redirect( admin_url( 'admin.php?page=brightcove-labels&add_label=1&refresh_labels=1' ) ); + + $redirect_url = admin_url( 'admin.php?page=brightcove-labels&refresh_labels=1' ); + + if ( ! empty( $label_name ) || ! empty( $label_path ) ) { + $this->cms_api->add_label( $label_name, $label_path ); + $redirect_url = add_query_arg( 'add_label', '1', $redirect_url ); + } + + wp_safe_redirect( $redirect_url ); exit; } } diff --git a/includes/class-bc-utility.php b/includes/class-bc-utility.php index c195b8f4..d1261634 100644 --- a/includes/class-bc-utility.php +++ b/includes/class-bc-utility.php @@ -310,7 +310,7 @@ public static function sanitize_payload_args_recursive( $args ) { if ( is_array( $value ) ) { $args[ $index ] = self::sanitize_payload_args_recursive( $value ); } else { - $args[ $index ] = utf8_uri_encode( sanitize_text_field( $value ) ); + $args[ $index ] = sanitize_text_field( $value ); } } @@ -329,7 +329,7 @@ public static function sanitize_payload_item( $item ) { return self::sanitize_payload_args_recursive( $item ); } - return utf8_uri_encode( sanitize_text_field( $item ) ); + return sanitize_text_field( $item ); } /** diff --git a/includes/sync/class-bc-videos.php b/includes/sync/class-bc-videos.php index c74e413b..952f7673 100644 --- a/includes/sync/class-bc-videos.php +++ b/includes/sync/class-bc-videos.php @@ -54,7 +54,7 @@ public function update_bc_video( $sanitized_post_data, $subtype = false ) { $update_data = array(); if ( array_key_exists( 'name', $sanitized_post_data ) && '' !== $sanitized_post_data['name'] ) { - $update_data['name'] = utf8_uri_encode( sanitize_text_field( $sanitized_post_data['name'] ) ); + $update_data['name'] = BC_Utility::sanitize_payload_item( $sanitized_post_data['name'] ); } if ( array_key_exists( 'description', $sanitized_post_data ) && ! empty( $sanitized_post_data['description'] ) ) {