Skip to content

Commit

Permalink
Merge pull request #369 from 10up/fix/357
Browse files Browse the repository at this point in the history
Fix: Only variables should be passed by reference
  • Loading branch information
MARQAS authored Feb 16, 2024
2 parents d63145c + 28f9217 commit 2dc8879
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions includes/admin/class-bc-admin-labels-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function __construct() {
* Renders html of the edit labels page
*/
public function render_edit_label_page() {
$label_name = isset( $_GET['update_label'] ) ? $_GET['update_label'] : ''; // phpcs:ignore WordPress.Security.NonceVerification
?>
<div class="wrap">
<h2>
Expand All @@ -46,13 +47,13 @@ public function render_edit_label_page() {
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" class="validate">
<?php wp_nonce_field( 'brightcove-edit-label', 'brightcove-edit-label-nonce' ); ?>
<input type="hidden" name="action" value="brightcove-edit-label">
<input type="hidden" name="label-path" value="<?php echo ! empty( $_GET['update_label'] ) ? esc_attr( $_GET['update_label'] ) : ''; // phpcs:ignore ?>">
<input type="hidden" name="label-path" value="<?php echo esc_attr( $label_name ); ?>">
<table class="form-table">
<tbody>
<tr class="form-field form-required term-name-wrap">
<th scope="row"><label for="name">Label</label></th>
<th scope="row"><label for="name"><?php esc_html_e( 'Label', 'brightcove' ); ?></label></th>
<td>
<input name="label-update" id="name" type="text" value="<?php echo esc_attr( end( array_filter( explode( '/', $_GET['update_label'] ) ) ) ); ?>" size="40" aria-required="true"> <?php // phpcs:ignore WordPress.Security.NonceVerification ?>
<input name="label-update" id="name" type="text" value="<?php echo esc_attr( basename( trim( $label_name, '/' ) ) ); ?>" size="40" aria-required="true">
<p class="description"><?php esc_html_e( 'Enter the new label name.', 'brightcove' ); ?></p>
</td>
</tr>
Expand Down

0 comments on commit 2dc8879

Please sign in to comment.