Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#23048 closed defect (bug) (duplicate)

make_clickable should not add http:// to ftp. hostnames by default (ftp:// is a better default)

Reported by: davidanderson's profile DavidAnderson Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Formatting Keywords:
Focuses: Cc:


make_clickable in wp-includes/formatting.php is a default filter.

One of its activities is to detect this regex, and to call _make_web_ftp_clickable_cb on it:


_make_web_ftp_clickable_cb then adds an <a href> tag, and pre-pends '

That seems quite wrong, as a default, for hostnames beginning with "ftp.". It bit me; I sent out an email with something like "FTP server:" in it. This went through WP Better Emails, and ended up via this filter as 'Host: <a href=""></a>' - i.e. ended up confusingly wrong.

I'm not sure that making links clickable by default is a good idea. But regardless of that, it's certainly wrong to *by default* change ftp. hostnames into http:// links, instead of into ftp:// links.

Therefore the third line of the function _make_web_ftp_clickable_cb in wp-includes/formatting.php should be changed from:

$dest = 'http://' . $dest;


$dest = ('ftp.' == substr($dest,0,4)) ? "ftp://" . $dest : "http://" . $dest;

Change History (2)

#1 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #22946.

#2 @DavidAnderson
11 years ago


Really sorry for reporting the same bug twice - I completely forgot I'd already done it! I still had it on a 'to-do' list and my memory failed me...

Note: See TracTickets for help on using tickets.