Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #22946


Ignore:
Timestamp:
12/15/2012 03:06:22 AM (10 years ago)
Author:
SergeyBiryukov
Comment:

Related: [4011]

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22946

    • Property Version changed from trunk to 2.0.4
    • Property Component changed from General to Formatting
  • Ticket #22946 – Description

    initial v2  
    55In my case, I was using the plugin WP Better Emails, and sent out an email with this line (approx):
    66
    7 'Here is the FTP server: ftp.example.com'
     7`Here is the FTP server: ftp.example.com`
    88
    99WP, by default, "helpfully" totally mangles this into:
    10 'Here is the FTP server: <a href="http://ftp.example.com">http://ftp.example.com</a>'
     10`Here is the FTP server: <a href="http://ftp.example.com">http://ftp.example.com</a>`
    1111
    1212The recipient of my email now believes that I was sending him an HTTP link, and is confused that it does not work. But in fact I never sent such a link - that was WordPress mangling what I did send.
     
    1515
    1616Proposed solution: on line 1471 of wp-includes/formatting.php (as found in 3.4.2), change:
    17 
     17{{{
    1818$ret = preg_replace_callback( '#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret );
    19 
     19}}}
    2020by removing the "ftp" case, hence:
    21 
     21{{{
    2222$ret = preg_replace_callback( '#([\s>])((www)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret );
    23 
     23}}}
    2424The function _make_web_ftp_clickable_cb should then be renamed by removing ftp_, since the case of turning FTP hostnames into clickable HTTP links would have been removed.