Error message when a URL has a % sign
-
Better Recent Comments causes an error message when the link URL features a % sign. That’s a rare occasion, as URLs generally don’t have % signs, but it can happen when using Better Recent Comments with Relevanssi, you may have a URL like this:
http://example.com/lorem-ipsum/?highlight=search%20phrase/#comment-27The % in the
%20will now cause asprintf: too few argumentserror.The solution is to edit line 112 in /includes/class-better-recent-comments-util.php and escape the % signs like this:
$link_fmt = '<a href="' . str_replace( '%', '%%', esc_url( get_comment_link( $comment->comment_ID ) ) ) . '">%s</a>';
The topic ‘Error message when a URL has a % sign’ is closed to new replies.