Permalink
Browse files

Bug: Can't proceed unless there's at least 1 bucket in S3.

  • Loading branch information...
1 parent 641942f commit 014c37bf1fd62dd8c904550b9ddafb0e475f3375 @bradt bradt committed Mar 1, 2013
Showing with 3 additions and 2 deletions.
  1. +1 −1 wordpress-s3/admin-options.php
  2. +2 −1 wordpress-s3/class-plugin.php
@@ -114,7 +114,7 @@ function s3_selectBucket(obj) {
<th width="33%" scope="row">Secret Access Key:</th>
<td><input type="text" name="options[secret]" value="<?php echo $options['secret'] ? '-- not shown --' : '';?>" size="50" /></td>
</tr>
-<?php if ( !isset( $buckets ) || !$buckets ):?>
+<?php if ( !isset( $buckets ) || !is_array( $buckets ) ):?>
<tr valign="top">
<td colspan="2">
<p class="submit">
@@ -110,7 +110,8 @@ function admin() {
if ( $options['key'] && $options['secret'] ) {
require_once dirname( __FILE__ ).'/lib.s3.php';
$s3 = new TanTanS3( $options['key'], $options['secret'] );
- if ( !( $buckets = $s3->listBuckets() ) ) {
+ $buckets = $s3->listBuckets();
+ if ( !is_array( $buckets ) ) {
$error = $this->getErrorMessage( $s3->parsed_xml, $s3->responseCode );
}

0 comments on commit 014c37b

Please sign in to comment.