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

Remove sanitizing for get_simple_local_avatar() #273

Merged
merged 1 commit into from
Apr 5, 2024
Merged
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
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
Loading