php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74493 Summary: On page links jump to incorrect anchors if the name contains the target
Submitted: 2017-04-24 07:50 UTC Modified: 2017-07-21 13:27 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: php-bugs-2014-08 at dotancohen dot com Assigned: peehaa (profile)
Status: Closed Package: Website problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2017-04-24 07:50 UTC] php-bugs-2014-08 at dotancohen dot com
Description:
------------
On the documentation page for the explode() function, inline links to "limit" scroll the page to the description for "Delimiter".

http://php.net/manual/en/function.explode.php

Tested in Chrome 52 and Firefox 52 on CentOS 7.3.

Test script:
---------------
1) Open web page in web browser:
http://php.net/manual/en/function.explode.php

2) Locate on page text 'limit'. Notice that 'limit' is color #336699 which indicates a link.

3) Click link.

EXPECTED
Page would scroll to 'limit' section.

ACTUALLY HAPPENS
Page scrolls to 'delimiter' section.

Expected result:
----------------
Page would scroll to 'limit' section.

Actual result:
--------------
Page scrolls to 'delimiter' section.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-24 08:04 UTC] peehaa@php.net
-Status: Open +Status: Verified -Package: Class/Object related +Package: Website problem
 [2017-04-24 08:04 UTC] peehaa@php.net
The links jumps to de*limit*er. Basically the first *limit* param the JS sess.

Should probably be made more strict to only jump to exact matches.
 [2017-04-24 08:05 UTC] peehaa@php.net
-Summary: var_export does not export a parsable string representation of stdClass objects +Summary: On page links jump to incorrect anchors if the name contains the target
 [2017-04-24 08:14 UTC] requinix@php.net
-Summary: On page links jump to incorrect anchors if the name contains the target +Summary: explode docs' "limit" param links jump to "delimiter" instead -Operating System: Linux melancholy 3.13.0-34-gener +Operating System:
 [2017-04-24 08:14 UTC] requinix@php.net
Because it's de-limit-er.

https://github.com/php/web-php/blob/master/js/common.js#L411
  '.parameters .parameter:contains("' + id + '"), .options .parameter:contains("' + id + '")'
 [2017-04-24 08:15 UTC] requinix@php.net
-Summary: explode docs' "limit" param links jump to "delimiter" instead +Summary: Summary: On page links jump to incorrect anchors if the name contains the target
 [2017-04-24 08:15 UTC] requinix@php.net
Ah, sorry @peehaa.
 [2017-04-24 13:20 UTC] peehaa@php.net
-Assigned To: +Assigned To: peehaa
 [2017-04-25 12:26 UTC] peehaa@php.net
Jay created a PR for to fix this https://github.com/php/web-php/pull/154

If somebody with powers could review and merge that please.
 [2017-04-25 14:30 UTC] levim@php.net
I'm not entirely sure why someone did "contains" in the first place but I'm inclined to believe there was actually a reason. I suppose we can commit this with an added comment that mentions this bug so when we uncover the reason it is like this we can do a proper fix.
 [2017-04-26 10:21 UTC] jay at room11 dot org
@levi - All done
 [2017-07-21 13:27 UTC] peehaa@php.net
-Status: Verified +Status: Closed
 [2017-07-21 13:27 UTC] peehaa@php.net
The fix for this bug has been committed. Since the websites are not directly
updated from the repository, the fix might need some time to spread
across the globe to all mirror sites, including PHP.net itself.

Thank you for the report, and for helping us make PHP.net better.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 10:01:29 2024 UTC