Page MenuHomePhabricator

Do not use href=# for any links
Open, LowPublic

Description

UniversalLanguageSelector generates buttons with JavaScript like <a href="#"> which allows a middle click with the mouse witch opens a new tab on the same page.

Either fill href with a suitable value where possible or don't set the attribute href or don't use the element a.

Details

Reference
bz41988

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:56 AM
bzimport set Reference to bz41988.
Fomafix created this task.Nov 10 2012, 10:04 PM

Had fixed this in upstream - https://github.com/wikimedia/jquery.uls/issues/27

Updated it in Mediawiki ULS extension. see gerrit I1efc7022

Thanks for fixing.

REOPENED because there are still buttons with <a href="#">.

More removed in gerrit I8eacaa45. Can you be bit more specific? Which buttons causing the issue?

Every <a href="#"> button cause this issue.

You removed two occurrence, but there are still buttons with this issue.

Examples:

  • trigger button
  • previous language button
santhosh removed santhosh as the assignee of this task.Nov 25 2014, 4:37 AM
santhosh set Security to None.

lib/jquery.ime/jquery.ime.js
1396: .attr( 'href', '#' )
1434: .attr( 'href', '#' )
1526: '<a class="ime-name imeselector-toggle" href="#"></a>' +

resources/js/ext.uls.interface.js
263: href: '#',

UniversalLanguageSelector.hooks.php
190: 'href' => '#',
382: 'default' => "<a id='uls-preferences-link' href='#'></a>",
443: 'href' => '#',

Nikerabbit renamed this task from Middle click with <a href="#"> to Do not use href=# for any links.Aug 18 2016, 1:08 PM
Nikerabbit updated the task description. (Show Details)

UniversalLanguageSelector.hooks.php
190: 'href' => '#',

is currently problematic, because makeListItem() in core omits the <a> entirely without the attribute href.