Ticket #55635: 55635.3.diff
| File 55635.3.diff, 2.1 KB (added by , 4 years ago) |
|---|
-
wp-includes/load.php
function is_ssl() { 1417 1417 1418 1418 if ( '1' == $_SERVER['HTTPS'] ) { 1419 1419 return true; 1420 1420 } 1421 1421 } elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) { 1422 1422 return true; 1423 1423 } 1424 1424 return false; 1425 1425 } 1426 1426 1427 1427 /** 1428 1428 * Converts a shorthand byte value to an integer byte value. 1429 1429 * 1430 1430 * @since 2.3.0 1431 1431 * @since 4.6.0 Moved from media.php to load.php. 1432 * @since 6.1.0 More closely resembles PHP parsing. 1432 1433 * 1433 1434 * @link https://www.php.net/manual/en/function.ini-get.php 1434 1435 * @link https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes 1435 1436 * 1436 1437 * @param string $value A (PHP ini) byte value, either shorthand or ordinary. 1437 1438 * @return int An integer byte value. 1438 1439 */ 1439 1440 function wp_convert_hr_to_bytes( $value ) { 1440 $value = strtolower( trim( $value ) ); 1441 $bytes = (int) $value; 1442 1443 if ( false !== strpos( $value, 'g' ) ) { 1444 $bytes *= GB_IN_BYTES; 1445 } elseif ( false !== strpos( $value, 'm' ) ) { 1446 $bytes *= MB_IN_BYTES; 1447 } elseif ( false !== strpos( $value, 'k' ) ) { 1441 $value = rtrim( $value ); 1442 $multi = strtolower( substr( $value, -1 ); 1443 $value = rtrim( $value, 'GgMmKk' ); // not technically needed, as intval will skip invalid chars. 1444 $bytes = intval( $value, 0 ); 1445 1446 if ( 'g' === $multiplier ) { 1447 $bytes *= GB_IN_BYES; 1448 } elseif ( 'm' === $multiplier ) { 1449 $bytes *= MB_IN_BYES; 1450 } elseif ( 'k' === $multiplier ) { 1448 1451 $bytes *= KB_IN_BYTES; 1449 1452 } 1450 1453 1451 // Deal with large (float) values which run into the maximum integer size. 1452 return min( $bytes, PHP_INT_MAX ); 1454 return (int) $bytes; 1453 1455 } 1454 1456 1455 1457 /** 1456 1458 * Determines whether a PHP ini value is changeable at runtime. 1457 1459 * 1458 1460 * @since 4.6.0 1459 1461 * 1460 1462 * @link https://www.php.net/manual/en/function.ini-get-all.php 1461 1463 * 1462 1464 * @param string $setting The name of the ini setting to check. 1463 1465 * @return bool True if the value is changeable at runtime. False otherwise. 1464 1466 */ 1465 1467 function wp_is_ini_value_changeable( $setting ) { 1466 1468 static $ini_all; 1467 1469