Coding Standards: Cast base_convert() to an integer before arithmetic operations.

Follow-up to [35477], [53104], [56101].

Props justlevine.
See #64238.
Built from https://develop.svn.wordpress.org/trunk@61247


git-svn-id: http://core.svn.wordpress.org/trunk@60559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2025-11-14 22:13:31 +00:00
parent c3ed2e5c37
commit c57ebd003e
3 changed files with 3 additions and 3 deletions

View File

@@ -1427,7 +1427,7 @@ function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $call
if ( null === $position || ! is_numeric( $position ) ) {
$menu[] = $new_menu;
} elseif ( isset( $menu[ (string) $position ] ) ) {
$collision_avoider = base_convert( substr( md5( $menu_slug . $menu_title ), -4 ), 16, 10 ) * 0.00001;
$collision_avoider = (int) base_convert( substr( md5( $menu_slug . $menu_title ), -4 ), 16, 10 ) * 0.00001;
$position = (string) ( $position + $collision_avoider );
$menu[ $position ] = $new_menu;
} else {

View File

@@ -246,7 +246,7 @@ class WP_Duotone {
'r' => (int) base_convert( $hex[0] . $hex[0], 16, 10 ),
'g' => (int) base_convert( $hex[1] . $hex[1], 16, 10 ),
'b' => (int) base_convert( $hex[2] . $hex[2], 16, 10 ),
'a' => 4 === strlen( $hex ) ? round( base_convert( $hex[3] . $hex[3], 16, 10 ) / 255, 2 ) : 1,
'a' => 4 === strlen( $hex ) ? round( (int) base_convert( $hex[3] . $hex[3], 16, 10 ) / 255, 2 ) : 1,
);
}

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '7.0-alpha-61246';
$wp_version = '7.0-alpha-61247';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.