From 047f022ac756cf7c7bb7cdbbea3057f9fa251c56 Mon Sep 17 00:00:00 2001 From: Niels Lange Date: Fri, 2 Apr 2021 17:41:26 +0700 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20Handle=20display=20na?= =?UTF-8?q?me=20with=20special=20chars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- co-authors-plus.php | 13 ++++++++++--- js/co-authors-plus.js | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/co-authors-plus.php b/co-authors-plus.php index 4815ac9d..3b97bc99 100755 --- a/co-authors-plus.php +++ b/co-authors-plus.php @@ -1205,8 +1205,15 @@ public function ajax_suggest() { } foreach ( $authors as $author ) { - $avatar_url = get_avatar_url( $author->ID ); - echo esc_html( $author->ID . ' | ' . $author->user_login . ' | ' . $author->display_name . ' | ' . $author->user_email . ' | ' . rawurldecode( $author->user_nicename ) ) . ' | ' . esc_url( $avatar_url ) . "\n"; + printf( + "%s ∣ %s ∣ %s ∣ %s ∣ %s ∣ %s \n", + esc_html( $author->ID ), + esc_html( $author->user_login ), + esc_html( str_replace( '∣', '|', $author->display_name ) ), + esc_html( $author->user_email ), + esc_html( rawurldecode( $author->user_nicename ) ), + esc_url( get_avatar_url( $author->ID ) ) + ); } die(); @@ -1376,7 +1383,7 @@ public function js_vars() { ?>