Make WordPress Core

Ticket #58878: 58878.diff

File 58878.diff, 2.5 KB (added by rajinsharwar, 3 years ago)
  • src/wp-includes/ID3/getid3.lib.php

    From fb887ed7d7f2d7025f7f6e7cf26a6e8651596adf Mon Sep 17 00:00:00 2001
    From: Rajinsharwar <rajinsharwar@gmail.com>
    Date: Sat, 22 Jul 2023 21:59:31 +0600
    Subject: [PATCH] Replacing with is_numeric
    
    ---
     src/wp-includes/ID3/getid3.lib.php       | 4 ++--
     src/wp-includes/ID3/module.tag.id3v1.php | 2 +-
     2 files changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/src/wp-includes/ID3/getid3.lib.php b/src/wp-includes/ID3/getid3.lib.php
    index 5242ce643f..79acfdcf6f 100644
    a b class getid3_lib  
    16171617                                                        }
    16181618                                                        if (is_array($value) || empty($ThisFileInfo['comments'][$tagname]) || !in_array(trim($value), $ThisFileInfo['comments'][$tagname])) {
    16191619                                                                $value = (is_string($value) ? trim($value) : $value);
    1620                                                                 if (!is_int($key) && !ctype_digit($key)) {
     1620                                                                if (!is_int($key) && !is_numeric($key)) {
    16211621                                                                        $ThisFileInfo['comments'][$tagname][$key] = $value;
    16221622                                                                } else {
    16231623                                                                        if (!isset($ThisFileInfo['comments'][$tagname])) {
    class getid3_lib  
    17851785                }
    17861786                if (isset($commandline)) {
    17871787                        $output = trim(`$commandline`);
    1788                         if (ctype_digit($output)) {
     1788                        if (is_numeric($output)) {
    17891789                                $filesize = (float) $output;
    17901790                        }
    17911791                }
  • src/wp-includes/ID3/module.tag.id3v1.php

    diff --git a/src/wp-includes/ID3/module.tag.id3v1.php b/src/wp-includes/ID3/module.tag.id3v1.php
    index b1de25784b..1abeebbd55 100644
    a b class getid3_id3v1 extends getid3_handler  
    8080                                // Since ID3v1 has no concept of character sets there is no certain way to know we have the correct non-ISO-8859-1 character set, but we can guess
    8181                                foreach ($ParsedID3v1['comments'] as $tag_key => $valuearray) {
    8282                                        foreach ($valuearray as $key => $value) {
    83                                                 if (preg_match('#^[\\x00-\\x40\\x80-\\xFF]+$#', $value) && !ctype_digit((string) $value)) { // check for strings with only characters above chr(128) and punctuation/numbers, but not just numeric strings (e.g. track numbers or years)
     83                                                if (preg_match('#^[\\x00-\\x40\\x80-\\xFF]+$#', $value) && !is_numeric((string) $value)) { // check for strings with only characters above chr(128) and punctuation/numbers, but not just numeric strings (e.g. track numbers or years)
    8484                                                        foreach (array('Windows-1251', 'KOI8-R') as $id3v1_bad_encoding) {
    8585                                                                if (function_exists('mb_convert_encoding') && @mb_convert_encoding($value, $id3v1_bad_encoding, $id3v1_bad_encoding) === $value) {
    8686                                                                        $ID3v1encoding = $id3v1_bad_encoding;