#32 Improved auto-format of URL's

v2,_Trinity
closed
nobody
5
2003-06-09
2003-02-08
Jesse Reid
No

Improve auto formating of http:// type links. In Subs.php

change:

$parts[$i] = preg_replace("/([\n
>\(])([\w\-_]+?):\/\/([\w\-_]+)((\.[\w\-_]+)+(:[\d]+)?((\/[\w\-_%]+(\.[\w\-_%]+)*)|(\/[~]?[\w\-_%]*))*(\/?(\?[&;=\w\+%]+)*)?(#[\w\-_]*)?)/",
"\\1[url=\\2://\\3\\4]\\2://\\3\\4[/url]", $parts[$i]);

to:

$parts[$i] = preg_replace("/([\n
>\(])([\w\-_]+?):\/\/([\w\-_]+)((\.[\w\-_]+)+(:[\d]+)?((\/[\w\-_=,%]+(\.[\w\-_%]+)*)|(\/[~]?[\w\-_%]*))*(\/?(\?[&;=\w\+%=\/-]+)*)?(#[\w\-_]*)?)/",
"\\1[url=\\2://\\3\\4]\\2://\\3\\4[/url]", $parts[$i]);

This covers a wider variety of URL's.

Discussion

  • David Recordon
    David Recordon
    2003-04-13

    • milestone: 219515 --> v2,_Trinity
     
  • Logged In: YES
    user_id=633762

    This has been revamped already, a different way - it works
    much better and is faster ;).

    See it in the next/upcoming release.

    -[Unknown]

     
    • status: open --> closed