Changeset 56975 for trunk/src/wp-includes/ID3/getid3.lib.php
- Timestamp:
- 10/20/2023 01:27:56 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ID3/getid3.lib.php
r54376 r56975 122 122 } 123 123 // if integers are 64-bit - no other check required 124 if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) { // phpcs:ignore PHPCompatibility.Constants.NewConstants.php_int_minFound124 if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) { 125 125 return true; 126 126 } 127 127 return false; 128 } 129 130 /** 131 * Perform a division, guarding against division by zero 132 * 133 * @param float|int $numerator 134 * @param float|int $denominator 135 * @param float|int $fallback 136 * @return float|int 137 */ 138 public static function SafeDiv($numerator, $denominator, $fallback = 0) { 139 return $denominator ? $numerator / $denominator : $fallback; 128 140 } 129 141 … … 135 147 public static function DecimalizeFraction($fraction) { 136 148 list($numerator, $denominator) = explode('/', $fraction); 137 return $numerator / ($denominator ? $denominator : 1);149 return (int) $numerator / ($denominator ? $denominator : 1); 138 150 } 139 151 … … 872 884 */ 873 885 public static function iconv_fallback_iso88591_utf8($string, $bom=false) { 874 if (function_exists('utf8_encode')) {875 return utf8_encode($string);876 }877 // utf8_encode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)878 886 $newcharstring = ''; 879 887 if ($bom) { … … 944 952 */ 945 953 public static function iconv_fallback_utf8_iso88591($string) { 946 if (function_exists('utf8_decode')) {947 return utf8_decode($string);948 }949 // utf8_decode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)950 954 $newcharstring = ''; 951 955 $offset = 0;
Note: See TracChangeset
for help on using the changeset viewer.