--- a/wp/wp-includes/widgets/class-wp-widget-links.php Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/widgets/class-wp-widget-links.php Wed Sep 21 18:19:35 2022 +0200
@@ -109,8 +109,8 @@
$instance['orderby'] = $new_instance['orderby'];
}
- $instance['category'] = intval( $new_instance['category'] );
- $instance['limit'] = ! empty( $new_instance['limit'] ) ? intval( $new_instance['limit'] ) : -1;
+ $instance['category'] = (int) $new_instance['category'];
+ $instance['limit'] = ! empty( $new_instance['limit'] ) ? (int) $new_instance['limit'] : -1;
return $instance;
}
@@ -138,7 +138,7 @@
)
);
$link_cats = get_terms( array( 'taxonomy' => 'link_category' ) );
- $limit = intval( $instance['limit'] );
+ $limit = (int) $instance['limit'];
if ( ! $limit ) {
$limit = -1;
}
@@ -148,7 +148,7 @@
<select class="widefat" id="<?php echo $this->get_field_id( 'category' ); ?>" name="<?php echo $this->get_field_name( 'category' ); ?>">
<option value=""><?php _ex( 'All Links', 'links widget' ); ?></option>
<?php foreach ( $link_cats as $link_cat ) : ?>
- <option value="<?php echo intval( $link_cat->term_id ); ?>" <?php selected( $instance['category'], $link_cat->term_id ); ?>>
+ <option value="<?php echo (int) $link_cat->term_id; ?>" <?php selected( $instance['category'], $link_cat->term_id ); ?>>
<?php echo esc_html( $link_cat->name ); ?>
</option>
<?php endforeach; ?>
@@ -181,7 +181,7 @@
<p>
<label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Number of links to show:' ); ?></label>
- <input id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo ( -1 !== $limit ) ? intval( $limit ) : ''; ?>" size="3" />
+ <input id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo ( -1 !== $limit ) ? (int) $limit : ''; ?>" size="3" />
</p>
<?php
}