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

Shared link invalid href attribute #130

Closed
matsonc opened this issue Dec 31, 2023 · 1 comment
Closed

Shared link invalid href attribute #130

matsonc opened this issue Dec 31, 2023 · 1 comment

Comments

@matsonc
Copy link

matsonc commented Dec 31, 2023

The shared link can have an invalid href attribute because the url is escaped using esc_attr instead of esc_url

Plugin version 1.4.1

Possible Solution

In wp-content\plugins\shared-counts\includes\class-shared-counts-front.php on line 685
replace esc_attr with esc_url

$elements['wrap_open']  = sprintf(
  '<a href="%s"%s%s%s class="%s"%s>',
  esc_attr( $link['link'] ),
  $attr_title,
  $target,
  $rel,
  $css_classes,
  $data
 );
$elements['wrap_open']  = sprintf(
  '<a href="%s"%s%s%s class="%s"%s>',
  esc_url( $link['link'] ),
  $attr_title,
  $target,
  $rel,
  $css_classes,
  $data
 );
@billerickson
Copy link
Collaborator

@matsonc I think I figured out why we were using esc_attr() . With this update, the print button no longer works.

See #133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants