WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/01/2020 07:05:04 PM (7 months ago)
Author:
desrosj
Message:

General: Fix various issues flagged by the PHPCompatibilityWP PHPCS ruleset.

As part of the continued effort to improve PHP compatibility, the following improvments are being made:

  • Removing deprecated PHP safe_mode checks not found in bundled external libraries.
  • Change the remaining while loops using each() to foreach loops.
  • Prevent false positives from being flagged for the sodium_compat library being caused by loading this in a non-standard way.
  • Add inline comments to not flag deprecated PHP directives in the getID3 library.

Props desrosj, earnjam, dryanpress.
See #49922.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpcompat.xml.dist

    r47122 r47735  
    4242
    4343    <!--
     44        PHPCompatibilityParagonieSodiumCompat prevents false positives in `sodium_compat`.
     45        However, because these files are included in a non-standard path, false positives are triggered in WordPress Core.
     46    -->
     47    <exclude-pattern>src/wp-includes/sodium_compat/lib/php72compat_const\.php$</exclude-pattern>
     48
     49    <rule ref="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_sign_keypair_from_secretkey_and_publickeyFound">
     50        <exclude-pattern>/sodium_compat/src/Compat\.php$</exclude-pattern>
     51    </rule>
     52    <rule ref="PHPCompatibility.FunctionUse.NewFunctions.sodium_padFound">
     53        <exclude-pattern>/sodium_compat/src/Compat\.php$</exclude-pattern>
     54    </rule>
     55    <rule ref="PHPCompatibility.FunctionUse.NewFunctions.sodium_unpadFound">
     56        <exclude-pattern>/sodium_compat/src/Compat\.php$</exclude-pattern>
     57    </rule>
     58
     59    <!--
    4460        PHPCompatibilityParagonieRandomCompat prevents false positives in `random_compat`.
    4561        However, because these files are included in a non-standard path, false positives are triggered in WordPress Core.
Note: See TracChangeset for help on using the changeset viewer.