Skip to content

Commit

Permalink
Remove sanitizing for get_simple_local_avatar()
Browse files Browse the repository at this point in the history
  • Loading branch information
ocean90 committed Apr 5, 2024
1 parent c792b5b commit c042125
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions includes/class-simple-local-avatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ public function edit_user_profile( $profileuser ) {
<div id="simple-local-avatar-photo" class="image-container" style="width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; flex-direction: column;">
<?php
add_filter( 'pre_option_avatar_rating', '__return_empty_string' ); // ignore ratings here
echo wp_kses_post( get_simple_local_avatar( $profileuser->ID ) );
echo get_simple_local_avatar( $profileuser->ID );
remove_filter( 'pre_option_avatar_rating', '__return_empty_string' );
?>
<span class="spinner" id="simple-local-avatar-spinner"></span>
Expand Down Expand Up @@ -1136,7 +1136,7 @@ public function action_remove_simple_local_avatar() {
$this->avatar_delete( $user_id ); // delete old images if successful

if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
echo wp_kses_post( get_simple_local_avatar( $user_id ) );
echo get_simple_local_avatar( $user_id );
}
}

Expand All @@ -1162,7 +1162,7 @@ public function ajax_assign_simple_local_avatar_media() {
$this->assign_new_user_avatar( $media_id, $user_id );
}

echo wp_kses_post( get_simple_local_avatar( $user_id ) );
echo get_simple_local_avatar( $user_id );

die;
}
Expand Down
4 changes: 0 additions & 4 deletions tests/phpunit/SimpleLocalAvatarsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,6 @@ public function test_edit_user_profile() {
->with( 1 )
->andReturn( '<img src="test-image-user-avatar"/>' );

WP_Mock::userFunction( 'wp_kses_post' )
->with( '<img src="test-image-user-avatar"/>' )
->andReturn( '<img src="test-image-user-avatar"/>' );

$profileuser = new stdClass();
$profileuser->ID = 1;

Expand Down

0 comments on commit c042125

Please sign in to comment.