Make WordPress Core

Changeset 60800


Ignore:
Timestamp:
09/26/2025 09:08:52 PM (4 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Move specific sniff exclusions for getID3 to the config file.

This aims to make future updates of the library easier.

Follow-up to [47735], [47737], [47902].

See #63168.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpcompat.xml.dist

    r60797 r60800  
    7777    -->
    7878
     79    <rule ref="PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved">
     80        <exclude-pattern>/ID3/getid3\.php$</exclude-pattern>
     81    </rule>
    7982    <rule ref="PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated">
     83        <exclude-pattern>/ID3/getid3\.php$</exclude-pattern>
    8084        <exclude-pattern>/PHPMailer/PHPMailer\.php$</exclude-pattern>
     85    </rule>
     86    <rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated">
     87        <exclude-pattern>/ID3/getid3\.php$</exclude-pattern>
     88    </rule>
     89    <rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_gpcDeprecated">
     90        <exclude-pattern>/ID3/getid3\.php$</exclude-pattern>
     91    </rule>
     92    <rule ref="PHPCompatibility.Lists.AssignmentOrder.Affected">
     93        <exclude-pattern>/ID3/module.audio-video.quicktime\.php$</exclude-pattern>
    8194    </rule>
    8295    <rule ref="PHPCompatibility.Constants.RemovedConstants.intl_idna_variant_2003Deprecated">
  • trunk/src/wp-includes/ID3/getid3.php

    r56975 r60800  
    426426
    427427        // Check safe_mode off
    428         if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
     428        if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) {
    429429            $this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.');
    430430        }
    431431
    432         // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
    433432        if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {
    434433            // http://php.net/manual/en/mbstring.overload.php
    435434            // "mbstring.func_overload in php.ini is a positive value that represents a combination of bitmasks specifying the categories of functions to be overloaded. It should be set to 1 to overload the mail() function. 2 for string functions, 4 for regular expression functions"
    436435            // getID3 cannot run when string functions are overloaded. It doesn't matter if mail() or ereg* functions are overloaded since getID3 does not use those.
    437             // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
    438436            $this->startup_error .= 'WARNING: php.ini contains "mbstring.func_overload = '.ini_get('mbstring.func_overload').'", getID3 cannot run with this setting (bitmask 2 (string functions) cannot be set). Recommended to disable entirely.'."\n";
    439437        }
     
    443441            // Check for magic_quotes_runtime
    444442            if (function_exists('get_magic_quotes_runtime')) {
    445                 // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated
    446443                if (get_magic_quotes_runtime()) { // @phpstan-ignore-line
    447444                    $this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'."\n";
     
    450447            // Check for magic_quotes_gpc
    451448            if (function_exists('get_magic_quotes_gpc')) {
    452                 // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_gpcDeprecated
    453449                if (get_magic_quotes_gpc()) { // @phpstan-ignore-line
    454450                    $this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'."\n";
     
    17911787            // currently vorbiscomment only works on OggVorbis files.
    17921788
    1793             // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
    17941789            if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) {
    17951790
  • trunk/src/wp-includes/ID3/module.audio-video.quicktime.php

    r56975 r60800  
    145145                $ISO6709parsed = array('latitude'=>false, 'longitude'=>false, 'altitude'=>false);
    146146                if (preg_match('#^([\\+\\-])([0-9]{2}|[0-9]{4}|[0-9]{6})(\\.[0-9]+)?([\\+\\-])([0-9]{3}|[0-9]{5}|[0-9]{7})(\\.[0-9]+)?(([\\+\\-])([0-9]{3}|[0-9]{5}|[0-9]{7})(\\.[0-9]+)?)?/$#', $ISO6709string, $matches)) {
    147                     // phpcs:ignore PHPCompatibility.Lists.AssignmentOrder.Affected
    148147                    @list($dummy, $lat_sign, $lat_deg, $lat_deg_dec, $lon_sign, $lon_deg, $lon_deg_dec, $dummy, $alt_sign, $alt_deg, $alt_deg_dec) = $matches;
    149148
Note: See TracChangeset for help on using the changeset viewer.