Skip to content

fix: escape URL and email in anchor(), anchor_popup() and mailto() - #10842

Open
paulbalandan wants to merge 1 commit into
codeigniter4:developfrom
paulbalandan:url-helper-escape-links
Open

paulbalandan wants to merge 1 commit into
codeigniter4:developfrom
paulbalandan:url-helper-escape-links

Conversation

@paulbalandan

Copy link
Copy Markdown
Member

Description
Fixes #10814.

For decision if acceptable: the escaping of URLs in onclick is now hex-escaped, e.g. http://example.com/index.php -> http\x3A\x2F\x2Fexample.com\x2Findex.php. An alternative would be to swap esc(..., 'js') with an addcslashes instead.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@carson-codeigniter4 carson-codeigniter4 Bot added the bug Verified issues on the current code behavior or pull requests that will fix them label Dec 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: anchor(), anchor_popup() and mailto() insert the URL into href and onclick unescaped

2 participants