added escaping functions for output part 1

the first files have no WPCS messages more
This commit is contained in:
Kniebremser
2019-07-06 22:53:15 +02:00
parent d8bc9ba8c5
commit 9a61003ec0
6 changed files with 129 additions and 95 deletions

15
404.php
View File

@@ -9,7 +9,8 @@
* @package Comicpress
*/
get_header(); ?>
get_header();
?>
<div class="post uentry type-page">
@@ -18,7 +19,7 @@ get_header(); ?>
<div class="post-info">
<h2 class="page-title">
<?php _e( 'Page Not Found', 'comicpress' ); ?>
<?php esc_html_e( 'Page Not Found', 'comicpress' ); ?>
</h2>
</div>
@@ -26,10 +27,10 @@ get_header(); ?>
<div class="entry">
<p>
<a href="<?php echo site_url(); ?>">
<?php _e( 'Click here to return to the home page', 'comicpress' ); ?>
<a href="<?php echo esc_html( site_url() ); ?>">
<?php esc_html_e( 'Click here to return to the home page', 'comicpress' ); ?>
</a>
<?php _e( 'or try a search:', 'comicpress' ); ?>
<?php esc_html_e( 'or try a search:', 'comicpress' ); ?>
</p>
<p>
<?php get_search_form(); ?>
@@ -45,4 +46,6 @@ get_header(); ?>
</div>
<?php get_footer(); ?>
<?php
get_footer();
?>

View File

@@ -1,4 +1,13 @@
<?php
/**
* Search Page
* by Philip M. Hofer (Frumph)
* http://frumph.net/
*
* Content for the Search page.
*
* @package Comicpress
*/
get_header();
@@ -7,115 +16,114 @@ if ( have_posts() ) :
$count = $wp_query->found_posts;
?>
<h2 class="page-title">
<h2 class="page-title">
<?php
_e( 'Search for &lsquo;', 'comicpress' );
the_search_query();
_e( '&rsquo;', 'comicpress'
);
?>
<?php
esc_html_e( 'Search for &lsquo;', 'comicpress' );
the_search_query();
esc_html_e( '&rsquo;', 'comicpress' );
?>
</h2>
</h2>
<div class="searchresults">
<div class="searchresults">
<?php
printf(
<?php
printf(
/* translators: Number of found results */
_n( '%d result', '%d results', 'comicpress' ),
$count
);
);
?>
</div>
<div class="clear"></div>
<?php
if ( comicpress_themeinfo( 'display_archive_as_links' ) ) {
?>
</div>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="entry">
<table class="archive-table">
<div class="clear"></div>
<?php
if ( comicpress_themeinfo( 'display_archive_as_links' ) ) {
while ( have_posts() ) :
the_post();
?>
<div <?php post_class(); ?>>
<tr>
<td class="archive-date">
<?php the_time( 'M d, Y' ); ?>
</td>
<td class="archive-title">
<a href="<?php echo esc_html( get_permalink( $post->ID ) ); ?>" rel="bookmark" title="<?php esc_html_e( 'Permanent Link:', 'comicpress' ); ?> <?php the_title(); ?>">
<?php the_title(); ?>
</a>
</td>
</tr>
<div class="post-head"></div>
<?php
endwhile;
?>
<div class="entry">
<table class="archive-table">
<?php
while ( have_posts() ) :
the_post();
?>
<tr>
<td class="archive-date">
<?php the_time( 'M d, Y' ); ?>
</td>
<td class="archive-title">
<a href="<?php echo get_permalink( $post->ID ); ?>" rel="bookmark" title="<?php _e( 'Permanent Link:', 'comicpress' ); ?> <?php the_title(); ?>">
<?php the_title(); ?>
</a>
</td>
</tr>
<?php
endwhile;
?>
</table>
</div>
<div class="post-foot"></div>
</table>
</div>
<?php
} else {
while ( have_posts() ) :
the_post();
$post_format = ( $post->post_type !== 'post' ) ? $post->post_type : get_post_format();
get_template_part( 'content', $post_format );
endwhile;
}
?>
<div class="post-foot"></div>
<div class="clear"></div>
</div>
<?php
} else {
while ( have_posts() ) :
the_post();
$post_format = ( $post->post_type !== 'post' ) ? $post->post_type : get_post_format();
get_template_part( 'content', $post_format );
endwhile;
}
?>
<div class="clear"></div>
<?php
comicpress_pagination();
else :
?>
<div class="post post-search uentry type-page">
<div class="post post-search uentry type-page">
<div class="post-head"></div>
<div class="post-head"></div>
<div class="post-content">
<div class="post-content">
<div class="entry">
<div class="entry">
<h3>
<?php _e( 'No results found.', 'comicpress' ); ?>
</h3>
<p>
<?php _e( 'Try another search?', 'comicpress' ); ?>
</p>
<p>
<?php get_search_form(); ?>
</p>
</div>
</div>
<div class="post-foot"></div>
<h3>
<?php esc_html_e( 'No results found.', 'comicpress' ); ?>
</h3>
<p>
<?php esc_html_e( 'Try another search?', 'comicpress' ); ?>
</p>
<p>
<?php get_search_form(); ?>
</p>
</div>
</div>
<div class="post-foot"></div>
</div>
<?php
endif;
get_footer();
?>

View File

@@ -1,5 +1,21 @@
<form method="get" class="searchform" action="<?php echo home_url(); ?>">
<input type="text" value="<?php _e( 'Search...', 'comicpress' ); ?>" name="s" class="s-search" onfocus="this.value=(this.value=='<?php _e( 'Search...', 'comicpress' ); ?>') ? '' : this.value;" onblur="this.value=(this.value=='') ? '<?php _e( 'Search...', 'comicpress' ); ?>' : this.value;" />
<button type="submit">&raquo;</button>
<?php
/**
* Search Form
* by Philip M. Hofer (Frumph)
* http://frumph.net/
*
* Method for the Search form.
*
* @package Comicpress
*/
?>
<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' ); ?>
</button>
</form>
<div class="clear"></div>
<div class="clear"></div>

View File

@@ -22,13 +22,13 @@
<div class="sidebar-no-widgets">
<?php _e( 'There are currently no widgets assigned to the left-sidebar, place some!', 'comicpress' ); ?>
<?php esc_html_e( 'There are currently no widgets assigned to the left-sidebar, place some!', 'comicpress' ); ?>
<br />
<br />
<?php _e( 'Once you add widgets to this sidebar, this default information will go away.', 'comicpress' ); ?>
<?php esc_html_e( 'Once you add widgets to this sidebar, this default information will go away.', 'comicpress' ); ?>
<br />
<br />
<?php _e( 'Widgets can be added by going to your dashboard (wp-admin) &#10132; Appearance &#10132; Widgets, drag a widget you want to see into one of the appropriate sidebars.', 'comicpress' ); ?>
<?php esc_html_e( 'Widgets can be added by going to your dashboard (wp-admin) &#10132; Appearance &#10132; Widgets, drag a widget you want to see into one of the appropriate sidebars.', 'comicpress' ); ?>
<br />
</div>

View File

@@ -22,13 +22,13 @@
<div class="sidebar-no-widgets">
<?php _e( 'There are currently no widgets assigned to the right-sidebar, place some!', 'comicpress' ); ?>
<?php esc_html_e( 'There are currently no widgets assigned to the right-sidebar, place some!', 'comicpress' ); ?>
<br />
<br />
<?php _e( 'Once you add widgets to this sidebar, this default information will go away.', 'comicpress' ); ?>
<?php esc_html_e( 'Once you add widgets to this sidebar, this default information will go away.', 'comicpress' ); ?>
<br />
<br />
<?php _e( 'Widgets can be added by going to your dashboard (wp-admin) &#10132; Appearance &#10132; Widgets, drag a widget you want to see into one of the appropriate sidebars.', 'comicpress' ); ?>
<?php esc_html_e( 'Widgets can be added by going to your dashboard (wp-admin) &#10132; Appearance &#10132; Widgets, drag a widget you want to see into one of the appropriate sidebars.', 'comicpress' ); ?>
<br />
</div>

View File

@@ -19,16 +19,23 @@ if ( have_posts() ) {
?>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="post">
<p>
<?php _e( 'Sorry, post is not found.', 'comicpress' ); ?>
<?php esc_html_e( 'Sorry, post is not found.', 'comicpress' ); ?>
</p>
<div class="clear"></div>
</div>
<div class="post-foot"></div>
</div>
<?php
}
get_footer();