projects
/
acontent.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
516c02d
)
make_clickable(): improve regular expression of converting URL to ignore the beginnin...
author
Cindy Li
<cli@ocad.ca>
Tue, 24 Aug 2010 14:20:57 +0000
(14:20 -0000)
committer
Cindy Li
<cli@ocad.ca>
Tue, 24 Aug 2010 14:20:57 +0000
(14:20 -0000)
docs/include/lib/output.inc.php
patch
|
blob
|
history
diff --git
a/docs/include/lib/output.inc.php
b/docs/include/lib/output.inc.php
index
672cb81
..
6aa0d81
100644
(file)
--- a/
docs/include/lib/output.inc.php
+++ b/
docs/include/lib/output.inc.php
@@
-677,7
+677,7
@@
function make_clickable($text) {
$text = preg_replace("/(\[media\])([\s]*)(.*)(\[\/media\])/", '$1$3$4', $text);
$text = preg_replace("/(\[media\])(.*)([\s]*)(\[\/media\])/U", '$1$2$4', $text);
// 2. convert URL
$text = preg_replace("/(\[media\])([\s]*)(.*)(\[\/media\])/", '$1$3$4', $text);
$text = preg_replace("/(\[media\])(.*)([\s]*)(\[\/media\])/U", '$1$2$4', $text);
// 2. convert URL
- $text = preg_replace('/(^|[\n ])([\w]*?
)((?<!(\[media\]))http(s)?:\/\/[\w]+[^ \,\"\n\r\t
<]*)/is',
+ $text = preg_replace('/(^|[\n ])([\w]*?
[\"]*)((?<!(\[media\]))http(s)?:\/\/[\w]+[^ \,\"\n\r\t\)
<]*)/is',
'$1$2<a href="$3">$3</a>', $text);
// convert email address to clickable URL that pops up "send email" interface with the address filled in
'$1$2<a href="$3">$3</a>', $text);
// convert email address to clickable URL that pops up "send email" interface with the address filled in