make URLs clickable

This commit is contained in:
Michal Čihař
2006-04-25 15:15:13 +00:00
parent adf542fc04
commit aad17c30da
2 changed files with 4 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ $Source$
* libraries/common.lib.php: Make cookie login form work with token * libraries/common.lib.php: Make cookie login form work with token
protection. protection.
* libraries/auth/cookie.auth.lib.php: Do not include empty values. * libraries/auth/cookie.auth.lib.php: Do not include empty values.
* changelog.php: Generate proper XHTML. * changelog.php: Generate proper XHTML, make URLs clickable.
2006-04-25 Sebastian Mendel <cybot_tm@users.sourceforge.net> 2006-04-25 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* db_details_qbe.php, db_printview.php, libraries/display_tbl.lib.php, * db_details_qbe.php, db_printview.php, libraries/display_tbl.lib.php,

View File

@@ -9,6 +9,9 @@
$changelog = htmlspecialchars(file_get_contents('ChangeLog')); $changelog = htmlspecialchars(file_get_contents('ChangeLog'));
$replaces = array( $replaces = array(
'@(http://[./a-zA-Z0-9.-]*[/a-zA-Z0-9])@'
=> '<a href="\\1">\\1</a>',
// sourceforge users // sourceforge users
'/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/i' '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/i'
=> '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>', => '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>',