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
|
| 1617 | 1617 | } |
| 1618 | 1618 | if (is_array($value) || empty($ThisFileInfo['comments'][$tagname]) || !in_array(trim($value), $ThisFileInfo['comments'][$tagname])) { |
| 1619 | 1619 | $value = (is_string($value) ? trim($value) : $value); |
| 1620 | | if (!is_int($key) && !ctype_digit($key)) { |
| | 1620 | if (!is_int($key) && !is_numeric($key)) { |
| 1621 | 1621 | $ThisFileInfo['comments'][$tagname][$key] = $value; |
| 1622 | 1622 | } else { |
| 1623 | 1623 | if (!isset($ThisFileInfo['comments'][$tagname])) { |
| … |
… |
class getid3_lib
|
| 1785 | 1785 | } |
| 1786 | 1786 | if (isset($commandline)) { |
| 1787 | 1787 | $output = trim(`$commandline`); |
| 1788 | | if (ctype_digit($output)) { |
| | 1788 | if (is_numeric($output)) { |
| 1789 | 1789 | $filesize = (float) $output; |
| 1790 | 1790 | } |
| 1791 | 1791 | } |
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
|
| 80 | 80 | // 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 |
| 81 | 81 | foreach ($ParsedID3v1['comments'] as $tag_key => $valuearray) { |
| 82 | 82 | 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) |
| 84 | 84 | foreach (array('Windows-1251', 'KOI8-R') as $id3v1_bad_encoding) { |
| 85 | 85 | if (function_exists('mb_convert_encoding') && @mb_convert_encoding($value, $id3v1_bad_encoding, $id3v1_bad_encoding) === $value) { |
| 86 | 86 | $ID3v1encoding = $id3v1_bad_encoding; |