Make WordPress Core


Ignore:
Timestamp:
03/09/2023 12:18:29 AM (3 years 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/src/wp-includes/formatting.php

    r55414 r55495  
    29192919
    29202920    $rel_attr = _make_clickable_rel_attr( $url );
    2921     return $matches[1] . "<a href=\"$url\"$rel_attr>$url</a>" . $suffix;
    2922 
     2921
     2922    return $matches[1] . "<a href=\"{$url}\"{$rel_attr}>{$url}</a>" . $suffix;
    29232923}
    29242924
     
    29522952
    29532953    $rel_attr = _make_clickable_rel_attr( $dest );
    2954     return $matches[1] . "<a href='{$dest}'{$rel_attr}>{$dest}</a>{$ret}";
     2954
     2955    return $matches[1] . "<a href=\"{$dest}\"{$rel_attr}>{$dest}</a>{$ret}";
    29552956}
    29562957
     
    29682969function _make_email_clickable_cb( $matches ) {
    29692970    $email = $matches[2] . '@' . $matches[3];
    2970     return $matches[1] . "<a href=\"mailto:$email\">$email</a>";
     2971
     2972    return $matches[1] . "<a href=\"mailto:{$email}\">{$email}</a>";
    29712973}
    29722974
     
    29802982 */
    29812983function _make_clickable_rel_attr( $url ) {
    2982 
    29832984    $rel_parts        = array();
    29842985    $scheme           = strtolower( wp_parse_url( $url, PHP_URL_SCHEME ) );
     
    30103011
    30113012    return $rel_attr;
    3012 
    30133013}
    30143014
Note: See TracChangeset for help on using the changeset viewer.