Ask not what osTicket community can do for you - ask what you can do for osTicket community

Go Back   osTicket Forums > Project Tools > osTicket Bug Tracker > Bug

Issue Type Bug   Project osTicket Bug Tracker
*some* links in ticket text broken when "make URLs clickable" is turned on
Only applies when link is at end-of-line, and followed by more text
Category Unknown
Affected Version 1.6.0 rc2
Priority Unknown
Status Fixed
Fixed Version 1.6 rc4
Submitted 01-22-2008
Assigned Users (none) Tags (none)

issueid=18 01-22-2008 02:38 AM
Member
*some* links in ticket text broken when "make URLs clickable" is turned on
Only applies when link is at end-of-line, and followed by more text

When "make URLs clickable" is turned on via admin panel, links both display and link incorrectly from within ticket text, but only when link is at end-of-line AND followed by more text.

Display is correct when links aren't parsed (e.g. "make URLs clickable" is turned off), or when link is inline with other text.

When display breaks, link contains <br as part of both href and description of link, and /> at the start of the following line.

Examples:
( -- is used to show where it starts and ends, so you can see extra blank lines)

Works Fine:
--
Here is an in-line link http://somelink.com/index.php with stuff after it
--

--
Here is a link at end of line with no text after it http://somelink.com/index.php
--

Broken:
--
Here is a link at end of line http://somelink.com/index.php
/> with text after it
--
HTML Code:
Here is a link at end of line<br />
<a href="http://somelink.com/index.php<br" target="_blank">http://somelink.com/index.php<br</a> />
 with text after it
Here is a link at end of line http://somelink.com/index.php
/>
with an extra line break and more text
--
HTML Code:
Here is a link at end of line<br />
<a href="http://somelink.com/index.php<br" target="_blank">http://somelink.com/index.php<br</a> />
<br />
with an extra line break and more text
Kind regards,
Ebonhand
Reply

01-24-2008 11:00 AM
Developer
 
The issue is resolved and fix will appear on the upcoming release (RC3). To patch your current RC2 installation simply replace clickableurls function in class.format.php as shown below;

PHP Code:
    function clickableurls($text) {

        
$text eregi_replace('(((f|ht){1}tp(s?)://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)','<a href="\\1" target=\"_blank\">\\1</a>'$text);
        
$text eregi_replace("(^|[ \n\r\t])(www\.([a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+)(/[^/ \n\r]*)*)",
                
"\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>"$text);
        
$text eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4})','<a href="mailto:\\1" target=\"_blank\">\\1</a>'$text);

        return 
$text;
    } 
Reply

Issue Tools
Subscribe to this issue

All times are GMT -4. The time now is 08:42 PM.