General: Replace older-style PHP type conversion functions with type casts.
This improves performance, readability, and consistency throughout core. * `intval()` → `(int)` * `strval()` → `(string)` * `floatval()` → `(float)` Props ayeshrajans. Fixes #42918. Built from https://develop.svn.wordpress.org/trunk@49108 git-svn-id: http://core.svn.wordpress.org/trunk@48870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -322,7 +322,7 @@ function wp_update_plugins( $extra_stats = array() ) {
|
||||
foreach ( $plugins as $file => $p ) {
|
||||
$new_option->checked[ $file ] = $p['Version'];
|
||||
|
||||
if ( ! isset( $current->checked[ $file ] ) || strval( $current->checked[ $file ] ) !== strval( $p['Version'] ) ) {
|
||||
if ( ! isset( $current->checked[ $file ] ) || (string) $current->checked[ $file ] !== (string) $p['Version'] ) {
|
||||
$plugin_changed = true;
|
||||
}
|
||||
}
|
||||
@@ -527,7 +527,7 @@ function wp_update_themes( $extra_stats = array() ) {
|
||||
$theme_changed = false;
|
||||
|
||||
foreach ( $checked as $slug => $v ) {
|
||||
if ( ! isset( $last_update->checked[ $slug ] ) || strval( $last_update->checked[ $slug ] ) !== strval( $v ) ) {
|
||||
if ( ! isset( $last_update->checked[ $slug ] ) || (string) $last_update->checked[ $slug ] !== (string) $v ) {
|
||||
$theme_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user