From 082f9f9739a8732199d9ff27b7c095c0972ebd45 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 22 Feb 2012 14:03:59 +0000 Subject: [PATCH] Use version_compare() when checking installed themes in the theme installer. fixes #20097. git-svn-id: https://develop.svn.wordpress.org/trunk@19979 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/theme-install.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/theme-install.php b/wp-admin/includes/theme-install.php index 40f4b85518..ab0cda348e 100644 --- a/wp-admin/includes/theme-install.php +++ b/wp-admin/includes/theme-install.php @@ -268,9 +268,9 @@ function install_theme_information() { $themes = get_themes(); foreach ( (array) $themes as $this_theme ) { if ( is_array($this_theme) && $this_theme['Stylesheet'] == $api->slug ) { - if ( $this_theme['Version'] == $api->version ) { + if ( version_compare( $this_theme['Version'], $api->version, '=' ) ) { $type = 'latest_installed'; - } elseif ( $this_theme['Version'] > $api->version ) { + } elseif ( version_compare( $this_theme['Version'], $api->version, '>' ) ) { $type = 'newer_installed'; $newer_version = $this_theme['Version']; }