From c57ebd003e58dce51db0386cc9ecd67412fef101 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 14 Nov 2025 22:13:31 +0000 Subject: [PATCH] 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 --- wp-admin/includes/plugin.php | 2 +- wp-includes/class-wp-duotone.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 300edff42f..aea415910c 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -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 { diff --git a/wp-includes/class-wp-duotone.php b/wp-includes/class-wp-duotone.php index a22745d895..2d0e72b19f 100644 --- a/wp-includes/class-wp-duotone.php +++ b/wp-includes/class-wp-duotone.php @@ -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, ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 544603fac2..ba19c65328 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.