Make WordPress Core

Changeset 53239


Ignore:
Timestamp:
04/21/2022 11:22:45 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Rename parameters that use reserved keywords in wp-includes/atomlib.php.

While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the $string parameter to $content in AtomParser::xml_escape().

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/atomlib.php

    r49182 r53239  
    389389    }
    390390
    391     function xml_escape($string)
     391    function xml_escape($content)
    392392    {
    393393             return str_replace(array('&','"',"'",'<','>'),
    394394                array('&amp;','&quot;','&apos;','&lt;','&gt;'),
    395                 $string );
     395                $content );
    396396    }
    397397}
Note: See TracChangeset for help on using the changeset viewer.