Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
185eecf
)
format_url() now adds http:// if there's no :
author
Jason Woofenden
<jason283@herkamire.com>
Mon, 17 Nov 2008 10:00:39 +0000
(
05:00
-0500)
committer
Jason Woofenden
<jason283@herkamire.com>
Mon, 17 Nov 2008 10:00:39 +0000
(
05:00
-0500)
format.php
patch
|
blob
|
history
diff --git
a/format.php
b/format.php
index
f93d47f
..
7acdde3
100644
(file)
--- a/
format.php
+++ b/
format.php
@@
-146,8
+146,14
@@
function format_email($str) {
}
function format_url($str) {
- # FIXME
- return format_oneline($str);
+ # FIXME check for TLD? encode special chars?
+ $str = trim(format_oneline($str));
+ if($str !== '') {
+ if(strpos($str, ':') === false) {
+ $str = 'http://' . $str;
+ }
+ }
+ return $str;
}
function format_money($str, $display_cents = true) {