-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them
Description
PHP Version
8.2
CodeIgniter4 Version
4.5.4
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
No response
What happened?
Using the URL Helper auto_link() function to automatically turn URLs contained in a string into links/HTML anchor elements. If the last character of the URL is a /, it is not included in either the anchor href value or text value.
Steps to Reproduce
Input:
$string = 'This is a test link to https://example.com/.';
$html = auto_link($string);
echo $html;Output:
This is a test link to <a href="https://example.com">https://example.com</a>/.Expected Output
This is a test link to <a href="https://example.com/">https://example.com/</a>.Anything else?
I came across this as it seems that the default behaviour of Chrome and Firefox is to include the trailing slash when copying the URL from the browser's address bar. I tend to do this a lot and noticed that the auto_link() function always missed the trailing slash when creating anchor elements.
Metadata
Metadata
Assignees
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them