Use esc_url instead of esc_attr for URLs. Improves security.

This commit is contained in:
Frank419
2024-08-27 13:02:56 +08:00
parent dcc18b8452
commit 57d25f9098
6 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ $default_image_location = get_theme_mod( 'minimalistflex_default_featured_images
</div>
<div class="panel-meta">
<?php if ( get_theme_mod( 'minimalistflex_interface_publisher', 'yes' ) == 'yes' ): ?>
<a class="panel-author" href="<?php echo esc_attr( get_author_posts_url($id) ) ?>">
<a class="panel-author" href="<?php echo esc_url( get_author_posts_url($id) ) ?>">
<span aria-hidden="true"><?php echo get_avatar( $id, 80 ) ?></span>
<?php the_author() ?>
</a>
+2 -2
View File
@@ -13,7 +13,7 @@ if ( !defined( 'WPINC' ) ) {
</div>
<?php foreach( $tags as $tag ) { ?>
<div class="singular-category">
<a href="<?php echo esc_attr( get_category_link( $tag ) ) ?>">
<a href="<?php echo esc_url( get_category_link( $tag ) ) ?>">
<?php echo $tag->name; ?>
</a>
</div>
@@ -28,7 +28,7 @@ if ( !defined( 'WPINC' ) ) {
</div>
<?php foreach( $tags as $tag ) { ?>
<div class="singular-category singular-tag">
<a href="<?php echo esc_attr( get_tag_link( $tag ) ) ?>">
<a href="<?php echo esc_url( get_tag_link( $tag ) ) ?>">
<?php echo $tag->name; ?>
</a>
</div>
+1 -1
View File
@@ -6,7 +6,7 @@ if ( !defined( 'WPINC' ) ) {
<div class="publisher">
<a class="publisher-link" href="<?php echo esc_attr( get_author_posts_url($id) ) ?>">
<a class="publisher-link" href="<?php echo esc_url( get_author_posts_url($id) ) ?>">
<?php echo get_avatar( $id, 32 ) ?>
<span><?php the_author() ?></span>
</a>