added escaping functions for output part 2

This commit is contained in:
Kniebremser
2019-07-07 13:48:35 +02:00
parent 9a61003ec0
commit 9225bc3987
10 changed files with 63 additions and 42 deletions

View File

@@ -23,7 +23,7 @@ if ( get_query_var( 'author_name' ) ) {
} if ( empty( $curauth ) ) { ?>
<h2>
<?php _e( 'No such author.', 'comicpress' ); ?>
<?php esc_html_e( 'No such author.', 'comicpress' ); ?>
</h2>
<?php
@@ -71,7 +71,7 @@ if ( get_query_var( 'author_name' ) ) {
<table class="user-info">
<tr>
<td class="user-info-name">
<?php _e( 'Registered on', 'comicpress' ); ?>
<?php esc_html_e( 'Registered on', 'comicpress' ); ?>
</td>
<td class="user-info-value">
<?php
@@ -81,7 +81,7 @@ if ( get_query_var( 'author_name' ) ) {
</tr>
<tr>
<td class="user-info-name">
<?php _e( 'Posts #', 'comicpress' ); ?>
<?php esc_html_e( 'Posts #', 'comicpress' ); ?>
</td>
<td class="user-info-value">
<?php
@@ -105,7 +105,7 @@ if ( get_query_var( 'author_name' ) ) {
<tr>
<td class="user-contacts-serv">
<?php _e( 'Email', 'comicpress' ); ?>
<?php esc_html_e( 'Email', 'comicpress' ); ?>
</td>
<td class="user-contacts-url">
<a href="mailto://<?php echo $curauth->user_email; ?>" target="_blank">
@@ -116,12 +116,12 @@ if ( get_query_var( 'author_name' ) ) {
<?php
}
if ( !empty( $curauth->user_url ) ) {
if ( ! empty( $curauth->user_url ) ) {
?>
<tr>
<td class="user-contacts-serv">
<?php _e( 'Website', 'comicpress' ); ?>
<?php esc_html_e( 'Website', 'comicpress' ); ?>
</td>
<td class="user-contacts-url">
<a href="<?php echo $curauth->user_url; ?>" target="_blank">
@@ -136,7 +136,7 @@ if ( get_query_var( 'author_name' ) ) {
<tr>
<td class="user-contacts-serv">
<?php _e( 'Twitter', 'comicpress' ); ?>
<?php esc_html_e( 'Twitter', 'comicpress' ); ?>
</td>
<td class="user-contacts-url">
<a href="<?php echo $curauth->twitter; ?>" target="_blank">
@@ -152,7 +152,7 @@ if ( get_query_var( 'author_name' ) ) {
<tr>
<td class="user-contacts-serv">
<?php _e( 'Facebook', 'comicpress' ); ?>
<?php esc_html_e( 'Facebook', 'comicpress' ); ?>
</td>
<td class="user-contacts-url">
<a href="<?php echo $curauth->facebook; ?>" target="_blank">

View File

@@ -3,7 +3,7 @@ if ( post_password_required() ) {
?>
<p class="nocomments">
<?php _e( 'This post is password protected. Enter the password to view comments.', 'comicpress' ); ?>
<?php esc_html_e( 'This post is password protected. Enter the password to view comments.', 'comicpress' ); ?>
</p>
<?php
@@ -173,7 +173,7 @@ if ( comments_open() ) {
?>
<p class="closed-comments">
<?php _e( 'Comments are closed.', 'comicpress' ); ?>
<?php esc_html_e( 'Comments are closed.', 'comicpress' ); ?>
</p>
<?php

View File

@@ -16,7 +16,7 @@
<div class="sticky-image">
<?php _e( 'Featured Post', 'comicpress' ); ?>
<?php esc_html_e( 'Featured Post', 'comicpress' ); ?>
</div>

View File

@@ -31,7 +31,7 @@ if ( ! is_home() && ! is_archive() && ! is_search() ) {
<div class="sticky-image">
<?php _e( 'Featured Post', 'comicpress' ); ?>
<?php esc_html_e( 'Featured Post', 'comicpress' ); ?>
</div>

View File

@@ -71,11 +71,11 @@ if ( ! function_exists( 'comicpress_display_post_thumbnail' ) ) {
if ( empty( $link ) ) $link = get_permalink();
if ( has_post_thumbnail() ) {
if ( is_home() ) {
$post_thumbnail = '<div class="post-image"><center><a href="'.$link.'" rel="featured-image" title="Link to ' . get_the_title() . '">' . get_the_post_thumbnail( $post->ID, $size ) . '</a></center></div>' . "\r\n";
$post_thumbnail = '<div class="post-image"><center><a href="' . $link . '" rel="featured-image" title="Link to ' . get_the_title() . '">' . get_the_post_thumbnail( $post->ID, $size ) . '</a></center></div>' . "\r\n";
} else $post_thumbnail = '<div class="post-image"><center>' . get_the_post_thumbnail( $post->ID, $size ) . '</center></div>' . "\r\n";
} else {
$url_image = get_post_meta ($post->ID, 'featured-image', true );
if ( ! empty( $url_image ) ) $post_thumbnail = '<div class="post-image"><center><a href="' . $link . '" rel="featured-image" title="Link to "' . get_the_title() . '"><img src="' . $url_image . '" title="' . get_the_title() .'" alt="' . get_the_title() . '"></a></center></div>' . "\r\n";
$url_image = get_post_meta( $post->ID, 'featured-image', true );
if ( ! empty( $url_image ) ) $post_thumbnail = '<div class="post-image"><center><a href="' . $link . '" rel="featured-image" title="Link to "' . get_the_title() . '"><img src="' . $url_image . '" title="' . get_the_title() . '" alt="' . get_the_title() . '"></a></center></div>' . "\r\n";
}
echo apply_filters( 'comicpress_display_post_thumbnail', $post_thumbnail );
}
@@ -89,7 +89,7 @@ if ( ! function_exists( 'comicpress_display_author_gravatar' ) ) {
global $post, $wp_query, $is_IE;
if ( is_page() ) return;
if ( comicpress_themeinfo( 'enable_post_author_gravatar' ) ) {
$author_get_gravatar = get_avatar(get_the_author_meta( 'email' ), 82, comicpress_random_default_avatar( get_the_author_meta( 'email' ), get_the_author_meta( 'display_name' ) ) );
$author_get_gravatar = get_avatar( get_the_author_meta( 'email' ), 82, comicpress_random_default_avatar( get_the_author_meta( 'email' ), get_the_author_meta( 'display_name' ) ) );
if ( ! $is_IE ) $author_get_gravatar = str_replace( 'photo', 'photo instant nocorner itxtalt', $author_get_gravatar );
$author_gravatar = "<div class=\"post-author-gravatar\">" . $author_get_gravatar . "</div>\r\n";
echo apply_filters( 'comicpress_display_author_gravatar', $author_gravatar );
@@ -104,7 +104,7 @@ if ( ! function_exists( 'comicpress_display_post_calendar' ) ) {
global $post, $wp_query;
if ( is_page() ) return;
if ( comicpress_themeinfo( 'enable_post_calendar' ) ) {
$post_calendar = "<div class=\"post-calendar-date\"><div class=\"calendar-date\"><span>" . get_the_time(' M' ) . "</span>" . get_the_time( 'd' ) . "</div></div>\r\n";
$post_calendar = "<div class=\"post-calendar-date\"><div class=\"calendar-date\"><span>" . get_the_time( ' M' ) . '</span>' . get_the_time( 'd' ) . "</div></div>\r\n";
echo apply_filters( 'comicpress_display_post_calendar', $post_calendar );
}
}
@@ -115,8 +115,8 @@ if ( ! function_exists( 'comicpress_display_post_author' ) ) {
function comicpress_display_post_author() {
global $post, $authordata;
if ( ! comicpress_themeinfo( 'disable_author_info_in_posts') ) {
$post_author = '<span class="post-author">'.__( 'by', 'comicpress' ) . ' <a href="' . get_author_posts_url( $authordata->ID, $authordata->user_nicename ) . '" rel="author">' . get_the_author().'</a></span>' . "\r\n";
if ( ! comicpress_themeinfo( 'disable_author_info_in_posts' ) ) {
$post_author = '<span class="post-author">' . __( 'by', 'comicpress' ) . ' <a href="' . get_author_posts_url( $authordata->ID, $authordata->user_nicename ) . '" rel="author">' . get_the_author() . '</a></span>' . "\r\n";
echo apply_filters( 'comicpress_display_post_author', $post_author );
}
}
@@ -128,7 +128,7 @@ if ( ! function_exists( 'comicpress_display_post_date' ) ) {
global $post;
if ( ! comicpress_themeinfo( 'disable_date_info_in_posts' ) ) {
$post_date = "<span class=\"posted-on\">".__( 'on', 'comicpress' ) . ' ' . "</span><span class=\"post-date\">" . get_the_date( get_option( 'date_format' ) ) . "</span>\r\n";
$post_date = "<span class=\"posted-on\">" . __( 'on', 'comicpress' ) . ' ' . "</span><span class=\"post-date\">" . get_the_date( get_option( 'date_format' ) ) . "</span>\r\n";
echo apply_filters( 'comicpress_display_post_date', $post_date );
}
}
@@ -199,7 +199,7 @@ if ( ! function_exists( 'comicpress_display_comment_link' ) ) {
<div class="comment-link">
<?php
comments_popup_link( '<span class="comment-balloon comment-balloon-empty">&nbsp;</span>' . __( 'Comment&nbsp;', 'comicpress' ), '<span class="comment-balloon">1</span> ' . __( 'Comment', 'comicpress' ), '<span class="comment-balloon">%</span> ' . __( 'Comments', 'comicpress' ) );
comments_popup_link( '<span class="comment-balloon comment-balloon-empty">&nbsp;</span>' . __( 'Comment&nbsp;', 'comicpress' ), '<span class="comment-balloon">1</span> ' . __( 'Comment', 'comicpress' ), '<span class="comment-balloon">%</span> ' . __( 'Comments', 'comicpress' ) );
?>
</div>
@@ -215,7 +215,7 @@ if ( ! function_exists( 'comicpress_display_blog_navigation' ) ) {
global $post, $wp_query;
if ( comicpress_themeinfo( 'enable_comments_on_homepage' ) && ( comicpress_themeinfo( 'home_post_count' ) == '1' ) ) {
$temp_single = $wp_query -> is_single;
$temp_single = $wp_query->is_single;
$wp_query->is_single = true;
}
if ( is_single() && ! is_page() && ! is_archive() && ! is_search() && ( $post->post_type == 'post' ) ) {
@@ -234,7 +234,7 @@ if ( ! function_exists( 'comicpress_display_blog_navigation' ) ) {
<?php
}
if ( comicpress_themeinfo( 'enable_comments_on_homepage' ) && ( comicpress_themeinfo( 'home_post_count' ) == '1') ) {
if ( comicpress_themeinfo( 'enable_comments_on_homepage' ) && ( comicpress_themeinfo( 'home_post_count' ) == '1' ) ) {
$wp_query->is_single = $temp_single;
}
}
@@ -251,7 +251,8 @@ if ( ! function_exists( 'comicpress_display_the_content' ) ) {
do_action( 'comicpress-display-the-content-after' );
} else {
if ( ! is_single() ) {
global $more; $more = 0;
global $more;
$more = 0;
}
do_action( 'comicpress-display-the-content-before' );
the_content( __( '&darr; Read the rest of this entry...', 'comicpress' ) );
@@ -290,7 +291,7 @@ if ( ! function_exists( 'comicpress_display_post' ) ) {
<div class="sticky-image">
<?php _e( 'Featured Post', 'comicpress' ); ?>
<?php esc_html_e( 'Featured Post', 'comicpress' ); ?>
</div>
@@ -364,7 +365,7 @@ if ( ! function_exists( 'comicpress_display_post' ) ) {
</div>
<?php
} else edit_post_link( __( 'Edit this page.', 'comicpress' ), '', '');
} else edit_post_link( __( 'Edit this page.', 'comicpress' ), '', '' );
?>
</div>

View File

@@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<meta name="ComicPress" content="<?php echo comicpress_themeinfo( 'version' ); ?>" />
<meta name="ComicPress" content="<?php echo esc_html( comicpress_themeinfo( 'version' ) ); ?>" />
<?php
wp_head();
@@ -27,7 +27,7 @@
<div class="header-info">
<h1>
<a href="<?php echo home_url(); ?>">
<a href="<?php echo esc_html( home_url() ); ?>">
<?php
bloginfo( 'name' );

View File

@@ -1,4 +1,14 @@
<?php
/**
* Image Page
* by Philip M. Hofer (Frumph)
* http://frumph.net/
*
* Content for the Image page.
*
* @package Comicpress
*/
get_header();
if ( have_posts() ) :
while ( have_posts() ) :
@@ -25,7 +35,10 @@ if ( have_posts() ) :
<div class="imagenav-arrow">
<?php _e( '&lsaquo;', 'comicpress' ); ?>
<?php
/* translators: Symbol for link previous image */
esc_html_e( '&lsaquo;', 'comicpress' );
?>
</div>
@@ -39,12 +52,12 @@ if ( have_posts() ) :
<div class="imagenav-center">
<a href="<?php echo wp_get_attachment_url( $post->ID ); ?>" target="_blank" title="<?php _e( 'Click for full size', 'comicpress' ); ?>" class="imagetitle">
<a href="<?php echo esc_html( wp_get_attachment_url( $post->ID ) ); ?>" target="_blank" title="<?php esc_html_e( 'Click for full size', 'comicpress' ); ?>" class="imagetitle">
<?php the_title(); ?>
</a>
<br />
<a href="<?php echo get_permalink( $post->post_parent ); ?>" rel="attachment">
<?php _e( '&larr; Back to Gallery', 'comicpress' ); ?>
<a href="<?php echo esc_html( get_permalink( $post->post_parent ) ); ?>" rel="attachment">
<?php esc_html_e( '&larr; Back to Gallery', 'comicpress' ); ?>
</a>
</div>
@@ -59,7 +72,10 @@ if ( have_posts() ) :
<div class="imagenav-arrow">
<?php _e( '&rsaquo;', 'comicpress' ); ?>
<?php
/* translators: Symbol for link next image */
esc_html_e( '&rsaquo;', 'comicpress' );
?>
</div>
@@ -79,8 +95,8 @@ if ( have_posts() ) :
<div class="gallery-image">
<a href="<?php echo wp_get_attachment_url( $post->ID ); ?>" target="_blank" title="<?php _e( 'Click for full size', 'comicpress' ); ?>" >
<img src="<?php echo wp_get_attachment_url( $post->ID ); ?>" alt="<?php the_title(); ?>" />
<a href="<?php echo esc_html( wp_get_attachment_url( $post->ID ) ); ?>" target="_blank" title="<?php esc_html_e( 'Click for full size', 'comicpress' ); ?>" >
<img src="<?php echo esc_html( wp_get_attachment_url( $post->ID ) ); ?>" alt="<?php the_title(); ?>" />
</a>
</div>
@@ -122,7 +138,7 @@ if ( have_posts() ) :
<div class="post-content">
<p>
<?php _e( 'Sorry, no image matched your criteria.', 'comicpress' ); ?>
<?php esc_html_e( 'Sorry, no image matched your criteria.', 'comicpress' ); ?>
</p>
<div class="clear"></div>

View File

@@ -21,7 +21,7 @@
<?php
if ( get_theme_mod( 'comicpress-customize-comic-in-column', false ) ) do_action( 'comic-area' );
if ( ! comicpress_is_signup() && !comicpress_sidebars_disabled()) {
if ( ! comicpress_is_signup() && ! comicpress_sidebars_disabled() ) {
if ( comicpress_is_layout( '3crgn' ) ) comicpress_get_sidebar( 'left' );
}
?>
@@ -32,7 +32,7 @@
do_action( 'comicpress-narrowcolumn-area' );
if ( ! comicpress_sidebars_disabled() ) {
if ( ! is_front_page() && ! comicpress_themeinfo( 'over-blog-sidebar-all-posts' ) ) return;
comicpress_get_sidebar( 'over-blog' );
comicpress_get_sidebar( 'over-blog' );
}
do_action( 'comic-blog-area' );
?>

View File

@@ -337,7 +337,7 @@ function comicpress_admin_options() {
<?php
printf(
/* translators: 1: Link to website 2: Additional link attribute 3: Theme versions number*/
__( '<a href="%1$1s" %2$2s> ComicPress</a> %3$3s', 'comicpress' ),
__( '<a href="%1$1s" %2$2s>ComicPress</a> %3$3s', 'comicpress' ),
esc_url( 'http://frumph.net/' ),
'target="_blank" rel="noopener noreferrer"',
comicpress_themeinfo( 'version' )
@@ -351,7 +351,7 @@ function comicpress_admin_options() {
<?php
printf(
/* translators: 1: Link to website 2: Additional link attribute */
__( 'Developed and maintained by <a href="%1$1s" %2$2s> Philip M. Hofer alias <small>(Frumph)</small></a>.', 'comicpress' ),
__( 'Developed and maintained by <a href="%1$1s" %2$2s>Philip M. Hofer alias <small>(Frumph)</small></a>.', 'comicpress' ),
esc_url( 'http://frumph.net/' ),
'target="_blank" rel="noopener noreferrer"'
);
@@ -359,7 +359,7 @@ function comicpress_admin_options() {
<?php
printf(
/* translators: 1: Link to website 2: Additional link attribute */
__( 'Originally created by <a href="%1$1s" %2$2s> Tyler Martin</a>.', 'comicpress' ),
__( 'Originally created by<a href="%1$1s" %2$2s> Tyler Martin</a>.', 'comicpress' ),
esc_url( 'http://mindfaucet.com/' ),
'target="_blank" rel="noopener noreferrer"'
);

View File

@@ -14,7 +14,11 @@
<form method="get" class="searchform" action="<?php echo esc_html( home_url() ); ?>">
<input type="text" value="<?php esc_html_e( 'Search...', 'comicpress' ); ?>" name="s" class="s-search" onfocus="this.value=(this.value=='<?php esc_html_e( 'Search...', 'comicpress' ); ?>') ? '' : this.value;" onblur="this.value=(this.value=='') ? '<?php esc_html_e( 'Search...', 'comicpress' ); ?>' : this.value;" />
<button type="submit">
<?php esc_html_e( '&raquo;', 'comicpress' ); ?>
<?php
/* translators: Content for search button */
esc_html_e( '&raquo;', 'comicpress' );
?>
</button>
</form>