From 8d5241c094e4e45768fee70bef93ac9e68fd47dc Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 23 Aug 2011 15:56:14 +0000 Subject: [PATCH] Check if property exists on plugins_api() returned object in install_plugin_information(). props hakre, fixes #18181. git-svn-id: https://develop.svn.wordpress.org/trunk@18586 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/plugin-install.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index 01b498ac38..29d2491e34 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -254,8 +254,10 @@ function install_plugin_information() { //Sanitize HTML foreach ( (array)$api->sections as $section_name => $content ) $api->sections[$section_name] = wp_kses($content, $plugins_allowedtags); - foreach ( array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key ) - $api->$key = wp_kses($api->$key, $plugins_allowedtags); + foreach ( array( 'version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug' ) as $key ) { + if ( isset( $api->$key ) ) + $api->$key = wp_kses( $api->$key, $plugins_allowedtags ); + } $section = isset($_REQUEST['section']) ? stripslashes( $_REQUEST['section'] ) : 'description'; //Default to the Description tab, Do not translate, API returns English. if ( empty($section) || ! isset($api->sections[ $section ]) )