From 89682d20134008348cb07a41796dfe3ec1136bd6 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 13 Sep 2013 06:53:09 +0000 Subject: [PATCH] WordPress Core Automatic Updates: Pass the Filesystem path as $context to request_filesystem_credentials(). See #22704 Built from https://develop.svn.wordpress.org/trunk@25422 git-svn-id: http://core.svn.wordpress.org/trunk@25347 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-upgrader-skins.php | 4 +++- wp-admin/includes/class-wp-upgrader.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-upgrader-skins.php b/wp-admin/includes/class-wp-upgrader-skins.php index fcc63fc9ba..13eea2c55e 100644 --- a/wp-admin/includes/class-wp-upgrader-skins.php +++ b/wp-admin/includes/class-wp-upgrader-skins.php @@ -541,7 +541,9 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin { class Automatic_Upgrader_Skin extends WP_Upgrader_Skin { var $messages = array(); - function request_filesystem_credentials( $error = false ) { + function request_filesystem_credentials( $error = false, $context = '' ) { + if ( $context ) + $this->options['context'] = $context; // TODO: fix up request_filesystem_credentials(), or split it, to allow us to request a no-output version // This will output a credentials form in event of failure, We don't want that, so just hide with a buffer ob_start(); diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 92f767e20d..d1bc082059 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -1352,7 +1352,7 @@ class WP_Automatic_Upgrader { static function can_auto_update( $context ) { if ( ! self::$skin ) self::$skin = new Automatic_Upgrader_Skin(); - return (bool) self::$skin->request_filesystem_credentials(); + return (bool) self::$skin->request_filesystem_credentials( false, $context ); } static function upgrade( $type, $item ) {