Make WordPress Core


Ignore:
Timestamp:
03/09/2023 12:18:29 AM (12 months ago)
Author:
SergeyBiryukov
Message:

Formatting: Restore consistent quotes in _make_web_ftp_clickable_cb().

After the introduction of _make_clickable_rel_attr() in an earlier commit, the function ended up returning link markup with a mix of single and double quotes.

This commit ensures that _make_web_ftp_clickable_cb() always returns double quotes, restoring consistency with other similar callback functions used by make_clickable():

  • _make_url_clickable_cb()
  • _make_email_clickable_cb()

Follow-up to [55289].

See #53290, #56444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/makeClickable.php

    r55289 r55495  
    109109        );
    110110        $urls_expected = array(
    111             "<a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>",
    112             "There was a spoon named <a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>. Alice!",
    113             "There was a spoon named <a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>, said Alice.",
    114             "There was a spoon named <a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>; said Alice.",
    115             "There was a spoon named <a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>: said Alice.",
    116             "There was a spoon named <a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>) said Alice.",
     111            '<a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>',
     112            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>. Alice!',
     113            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>, said Alice.',
     114            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>; said Alice.',
     115            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>: said Alice.',
     116            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>) said Alice.',
    117117        );
    118118
     
    136136        );
    137137        $urls_expected = array(
    138             "<a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>",
    139             "There was a spoon named <a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>.",
    140             "There was a spoon named <a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>,",
    141             "There was a spoon named <a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>;",
    142             "There was a spoon named <a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>:",
    143             "There was a spoon named <a href='http://www.wordpress.org' rel=\"nofollow\">http://www.wordpress.org</a>)",
     138            '<a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>',
     139            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>.',
     140            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>,',
     141            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>;',
     142            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>:',
     143            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>)',
    144144        );
    145145
     
    440440
    441441    public function data_add_rel_ugc_in_comments() {
    442 
    443442        $home_url_http  = set_url_scheme( home_url(), 'http' );
    444443        $home_url_https = set_url_scheme( home_url(), 'https' );
     
    452451            array(
    453452                'www.wordpress.org',
    454                 '<p><a href=\'http://www.wordpress.org\' rel="nofollow ugc">http://www.wordpress.org</a>',
     453                '<p><a href="http://www.wordpress.org" rel="nofollow ugc">http://www.wordpress.org</a>',
    455454            ),
    456455            // @ticket 56444
    457456            array(
    458457                'www.example.org',
    459                 '<p><a href=\'http://www.example.org\' rel="nofollow ugc">http://www.example.org</a>',
     458                '<p><a href="http://www.example.org" rel="nofollow ugc">http://www.example.org</a>',
    460459            ),
    461460            array(
Note: See TracChangeset for help on using the changeset viewer.