Skip to content

Commit

Permalink
M core/string_api.php
Browse files Browse the repository at this point in the history
M doc/ChangeLog
- Fix #2976: Incorrect handling of URLs. The problem was that when a url is at
the end of a line, the string insert hrefs function takes the url as
"http://www.hotmail.com<br".  This was fixed by excluding the < from the valid
characters of the link.


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1982 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed Feb 21, 2003
1 parent b56c874 commit 5b26162
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/string_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: string_api.php,v 1.28 2003-02-18 01:41:50 jfitzell Exp $
# $Id: string_api.php,v 1.29 2003-02-21 01:40:08 vboctor Exp $
# --------------------------------------------------------

$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
Expand Down Expand Up @@ -34,7 +34,7 @@ function string_display( $p_string ) {
# bug references, and cvs references
function string_display_links( $p_string ) {
$p_string = string_display( $p_string );

$p_string = string_insert_hrefs( $p_string );
$p_string = string_process_bug_link( $p_string );
$p_string = string_process_cvs_link( $p_string );
Expand Down Expand Up @@ -162,10 +162,10 @@ function string_insert_hrefs( $p_string ) {
return $p_string;
}

$p_string = eregi_replace( "([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])",
$p_string = eregi_replace( "([[:alnum:]]+)://([^[:space:]<]*)([[:alnum:]#?/&=])",
"<a href=\"\\1://\\2\\3\">\\1://\\2\\3</a>",
$p_string);
$p_string = eregi_replace( "(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))",
$p_string = eregi_replace( "(([a-z0-9_]|\\-|\\.)+@([^[:space:]<]*)([[:alnum:]-]))",
"<a href=\"mailto:\\1\" target=\"_new\">\\1</a>",
$p_string);
return $p_string;
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -18,6 +18,7 @@ Mantis ChangeLog
* Fix #2969: Bug not found error when deleting a bugnote.
* Fix #2970: Sending a reminder sends two notifications.
* Fix #2974: Message "APPLICATION WARNING #300" on main page.
* Fix #2976: Incorrect handling of URLs.
* Fix #2978: URLs not hyperlinked in news_add page.
* Fix #2982: Having email_set_category set to EMAIL_CATEGORY_PROJECT_CATEGORY erased various mail headers.
* Languages: Updated German localisation.
Expand Down

0 comments on commit 5b26162

Please sign in to comment.