Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.78k stars 894 forks source link

Invalid double anchor # in urls #21605

Open kkmuffme opened 2 months ago

kkmuffme commented 2 months ago

Please give us a description of what happened

On some pages the URLs have a double anchor e.g. /wp-admin/admin.php?page=wpseo_tools&tool=import-export contains a href="#top#import-seo"

To Reproduce

Step-by-step reproduction instructions

  1. open /wp-admin/admin.php?page=wpseo_tools&tool=import-export
  2. see wrong URL in dev tools

Expected results

  1. only 1 anchor

Actual results

  1. multiple # anchors

This bug can be seen in multiple files in the plugin, e.g. https://github.com/Yoast/wordpress-seo/blob/trunk/admin/class-admin.php#L244

Here's a list of files that have this issue I found with a quick grep: https://github.com/Yoast/wordpress-seo/blob/trunk/admin/class-admin.php https://github.com/Yoast/wordpress-seo/blob/trunk/admin/class-option-tabs-formatter.php https://github.com/Yoast/wordpress-seo/blob/trunk/admin/class-bulk-editor-list-table.php https://github.com/Yoast/wordpress-seo/blob/trunk/admin/views/tool-bulk-editor.php https://github.com/Yoast/wordpress-seo/blob/trunk/admin/views/tool-import-export.php https://github.com/Yoast/wordpress-seo/blob/trunk/admin/views/tabs/tool/wpseo-export.php https://github.com/Yoast/wordpress-seo/blob/trunk/admin/views/tabs/tool/wpseo-import.php https://github.com/Yoast/wordpress-seo/blob/trunk/admin/views/tabs/tool/import-seo.php https://github.com/Yoast/wordpress-seo/blob/trunk/src/integrations/admin/first-time-configuration-notice-integration.php https://github.com/Yoast/wordpress-seo/blob/trunk/src/integrations/admin/installation-success-integration.php https://github.com/Yoast/wordpress-seo/blob/trunk/src/integrations/admin/old-configuration-integration.php https://github.com/Yoast/wordpress-seo/blob/trunk/src/integrations/admin/workouts-integration.php

josevarghese commented 2 months ago

Hi @kkmuffme

Thanks for using the Yoast SEO plugin and for creating an issue. I didn't find any issue with the settings loading of any settings page or causing any issues with having #top#import-seo or the jump links having two # anchors. So, I am closing this issue as it's not causing any issues to the plugin.

kkmuffme commented 2 months ago

https://datatracker.ietf.org/doc/html/rfc3986

The # symbol is used to introduce the fragment, and there is only one fragment component allowed, because the specification only allows one # followed by the fragment identifier. The presence of more than one # symbol is not permitted because only the first # and everything following it is considered part of the fragment identifier.

josevarghese commented 2 months ago

Hi @kkmuffme

Thanks for sharing the details. I am re-opening this issue after consulting with our development team.

What's next? Our product team will assess the severity of this problem in relation to other open bug reports and new features. Based on their assessment, the bug report will be given a priority level. Our developers work on the highest priority issues first. Unfortunately, this means we cannot give you an estimate of when they'll start working on your report.