Skip to content

Commit

Permalink
Merge branch 'develop' into fix/354
Browse files Browse the repository at this point in the history
  • Loading branch information
MARQAS authored Feb 15, 2024
2 parents ec6153d + 9e68966 commit abd3661
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
14 changes: 7 additions & 7 deletions includes/admin/class-bc-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,8 @@ class="brightcove-datetime brightcove-end-date"
<# } #>
</div>
<div class="media-actions">
<a href="#" class="button media-button brightcove edit"><?php esc_html_e( 'Edit', 'brightcove' ); ?></a>
<a href="#" class="button media-button brightcove preview"><?php esc_html_e( 'Preview', 'brightcove' ); ?></a>
<button class="button media-button brightcove edit"><?php esc_html_e( 'Edit', 'brightcove' ); ?></button>
<button class="button media-button brightcove preview"><?php esc_html_e( 'Preview', 'brightcove' ); ?></button>
</div>
</div>
</script>
Expand Down Expand Up @@ -724,14 +724,14 @@ class="brightcove-datetime brightcove-end-date"

<div class="media-actions">
<# if ('preview' === data.detailsMode) { #>
<a href="#" class="button media-button brightcove back"><?php esc_html_e( 'Back', 'brightcove' ); ?></a>
<button class="button media-button brightcove back"><?php esc_html_e( 'Back', 'brightcove' ); ?></button>
<# } else { #>
<# if ( data.images && data.images.thumbnail && data.images.thumbnail.src ) { #>
<a href="#" class="button media-button brightcove edit"><?php esc_html_e( 'Edit', 'brightcove' ); ?></a>
<a href="#" class="button media-button brightcove preview"><?php esc_html_e( 'Preview', 'brightcove' ); ?></a>
<button class="button media-button brightcove edit"><?php esc_html_e( 'Edit', 'brightcove' ); ?></button>
<button class="button media-button brightcove preview"><?php esc_html_e( 'Preview', 'brightcove' ); ?></button>
<# } else { #>
<a href="#" class="button media-button brightcove edit" disabled><?php esc_html_e( 'Edit', 'brightcove' ); ?></a>
<a href="#" class="button media-button brightcove preview" disabled><?php esc_html_e( 'Preview', 'brightcove' ); ?></a>
<button class="button media-button brightcove edit" disabled><?php esc_html_e( 'Edit', 'brightcove' ); ?></button>
<button class="button media-button brightcove preview" disabled><?php esc_html_e( 'Preview', 'brightcove' ); ?></button>
<# } #>
<# } #>
</div>
Expand Down
11 changes: 9 additions & 2 deletions includes/class-bc-labels.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions includes/class-bc-utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}

Expand All @@ -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 );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/sync/class-bc-videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) ) {
Expand Down

0 comments on commit abd3661

Please sign in to comment.