Skip to content

Commit aae6634

Browse files
Coding Standards: Cast base_convert() to an integer before arithmetic operations.
Follow-up to [35477], [53104], [56101]. Props justlevine. See #64238. git-svn-id: https://develop.svn.wordpress.org/trunk@61247 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 23f17ae commit aae6634

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/wp-admin/includes/plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $call
14271427
if ( null === $position || ! is_numeric( $position ) ) {
14281428
$menu[] = $new_menu;
14291429
} elseif ( isset( $menu[ (string) $position ] ) ) {
1430-
$collision_avoider = base_convert( substr( md5( $menu_slug . $menu_title ), -4 ), 16, 10 ) * 0.00001;
1430+
$collision_avoider = (int) base_convert( substr( md5( $menu_slug . $menu_title ), -4 ), 16, 10 ) * 0.00001;
14311431
$position = (string) ( $position + $collision_avoider );
14321432
$menu[ $position ] = $new_menu;
14331433
} else {

src/wp-includes/class-wp-duotone.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ private static function colord_parse_hex( $hex ) {
246246
'r' => (int) base_convert( $hex[0] . $hex[0], 16, 10 ),
247247
'g' => (int) base_convert( $hex[1] . $hex[1], 16, 10 ),
248248
'b' => (int) base_convert( $hex[2] . $hex[2], 16, 10 ),
249-
'a' => 4 === strlen( $hex ) ? round( base_convert( $hex[3] . $hex[3], 16, 10 ) / 255, 2 ) : 1,
249+
'a' => 4 === strlen( $hex ) ? round( (int) base_convert( $hex[3] . $hex[3], 16, 10 ) / 255, 2 ) : 1,
250250
);
251251
}
252252

0 commit comments

Comments
 (0)