aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-11 13:07:26 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-11 13:07:26 +0000
commit3ca26ac166e6f1021e23f4e4c3f50466aedfb04e (patch)
tree3ac5f25914b1dbd8577a5ffe8bb8d8be039f2144 /engine
parent3e062ff608a92c0c6161dfb20323b5e7953e8486 (diff)
downloadelgg-3ca26ac166e6f1021e23f4e4c3f50466aedfb04e.tar.gz
elgg-3ca26ac166e6f1021e23f4e4c3f50466aedfb04e.tar.bz2
Closes #684: Scratching a particular itch of mine by no longer hiding urls when converting them to active links. This issue has caused many a headache. The url is now preserved but with a <wbr /> inserted after every /, this lets long urls be wrapped without breaking the url.
git-svn-id: https://code.elgg.org/elgg/trunk@2717 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/input.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/engine/lib/input.php b/engine/lib/input.php
index b338e530c..80329462e 100644
--- a/engine/lib/input.php
+++ b/engine/lib/input.php
@@ -116,12 +116,12 @@
**/
function parse_urls($text) {
-
+
if (preg_match_all('/(?<!=["\'])((ht|f)tps?:\/\/[^\s\r\n\t<>"\'\!\(\)]+)/ie', $text, $urls)) {
foreach (array_unique($urls[1]) AS $url){
- $urltext = $url;
- $text = str_replace($url, '<a href="'. $url .'" style="text-decoration:underline;">'. elgg_echo("link:view") .'</a>', $text);
+ $urltext = str_replace('/', '/<wbr />', $url);
+ $text = str_replace($url, '<a href="'. $url .'" style="text-decoration:underline;">'. $urltext .'</a>', $text);
}
}