(.+)<\/div>/", $form, $matches ) ) {
$error = $matches[2];
$form = str_replace( $matches[0], '', $form );
}
if ( !$success ) {
throw new Util_WpFile_FilesystemOperationException( $error, $form );
}
}
/**
*
*
* @param string $method
* @param string $url
* @param bool|string $context
* @return Util_WpFile_FilesystemOperationException with S/FTP form
*/
static private function get_filesystem_credentials_form( $method = '', $url = '',
$context = false ) {
// Ensure request_filesystem_credentials() is available.
require_once ABSPATH . 'wp-admin/includes/file.php';
require_once ABSPATH . 'wp-admin/includes/template.php';
ob_start();
// If first check failed try again and show error message
request_filesystem_credentials( $url, $method, true, false, array() );
$success = false;
$form = ob_get_contents();
ob_end_clean();
$error = '';
if ( preg_match( "/
(.+)<\/div>/", $form, $matches ) ) {
$form = str_replace( $matches[0], '', $form );
}
$form = str_replace( '