Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace strip_tags() with wp_strip_all_tags() in bundled themes #8537

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyeleven/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
$metadata['width'],
$metadata['height'],
esc_url( get_permalink( $post->post_parent ) ),
esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ),
esc_attr( wp_strip_all_tags( get_the_title( $post->post_parent ) ) ),
get_the_title( $post->post_parent )
);
?>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyeleven/inc/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function widget( $args, $instance ) {
*/
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['title'] = wp_strip_all_tags( $new_instance['title'] );
$instance['number'] = (int) $new_instance['number'];
$this->flush_widget_cache();

Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyfourteen/inc/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public function widget( $args, $instance ) {
* @return array Updated widget instance.
*/
public function update( $new_instance, $old_instance ) {
$old_instance['title'] = strip_tags( $new_instance['title'] );
$old_instance['title'] = wp_strip_all_tags( $new_instance['title'] );
$old_instance['number'] = empty( $new_instance['number'] ) ? 2 : absint( $new_instance['number'] );

if ( in_array( $new_instance['format'], $this->formats, true ) ) {
Expand Down
8 changes: 2 additions & 6 deletions src/wp-content/themes/twentyten/loop-attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@
the_post();
?>

<?php
if ( ! empty( $post->post_parent ) ) :
/* translators: %s: Post title. */
$post_title = sprintf( __( 'Go to %s', 'twentyten' ), strip_tags( get_the_title( $post->post_parent ) ) );
?>
<p class="page-title"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php echo esc_attr( $post_title ); ?>" rel="gallery">
<?php if ( ! empty( $post->post_parent ) ) : ?>
<p class="page-title"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" rel="gallery">
<?php
/* translators: %s: Title of parent post. */
printf( __( '<span class="meta-nav">&larr;</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentythirteen/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( get_permalink( $post->post_parent ) ),
esc_attr( strip_tags( $post_title ) ),
esc_attr( wp_strip_all_tags( $post_title ) ),
$post_title
);

Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentytwelve/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$metadata['width'],
$metadata['height'],
esc_url( get_permalink( $post->post_parent ) ),
esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ),
esc_attr( wp_strip_all_tags( get_the_title( $post->post_parent ) ) ),
get_the_title( $post->post_parent )
);
?>
Expand Down
Loading