SMF icon indicating copy to clipboard operation
SMF copied to clipboard

IURL anchor links force url

Open jdarwood007 opened this issue 2 years ago • 2 comments

Description

When you use iurl to link to a anchor bbc in a post, it incorrectly will force the entire url into the post.

Steps to reproduce

  1. Create new post.
  2. Use contents:
[iurl="#db_query"]$smcFunc['db_query'][/iurl]

TEST

[anchor=db_query]$smcFunc['db_query'] (identifier, query, values, connection)[/anchor]
  1. Post the message
  2. Edit the message
  3. Results show the iurl now contains $scripturl=action=post.....#anchor]

Environment (complete as necessary)

  • Version/Git revision: latest
  • Database Type: N/a
  • Database Version: N/a
  • PHP Version: PHP 8.1 and PHP 8.2

Additional information/references

Noticed on sm.org and confirmed in my dev env.

jdarwood007 avatar Mar 19 '23 19:03 jdarwood007

Seems to be because we pass it through encodeURI()

live627 avatar Dec 22 '23 09:12 live627

Possible side effect seen here? https://www.simplemachines.org/community/index.php?topic=583430.0

DiegoAndresCortes avatar Dec 22 '23 19:12 DiegoAndresCortes