Skip to content

Conversation

@asuth
Copy link

@asuth asuth commented Feb 22, 2012

Using a simple bucket name caused the bucket name to be marked as non-DNS compatible.

@tpyo
Copy link
Owner

tpyo commented Apr 18, 2012

Sorry for the late follow up. Could you give an example of a bucket name that would fail?

@asuth
Copy link
Author

asuth commented Apr 18, 2012

I think it was something like "subdomain.example.com"

@edwardrf
Copy link

I would like to double confirm the error.

The current code is

if (strlen($bucket) > 63 || !preg_match("/[^a-z0-9\.-]/", $bucket)) return false;

Means
for any bucket name is longer than 63 characters it is not a valid domain name OR
for any bucket name that does NOT contain anything OTHER THAN a-z0-9.- is not a valid domain => bucket name contains only a-z0-9.- is NOT a valid domain name, which is false.

However because the us standard bucket accepts both syntax of:

PUT /bucketname/uri
Host: s3.amazon.com

OR

PUT /uri
Host: bucketname.s3.amazon.com

The faulty logic listed above is always generating the 1st type of request, and when the bucket is not a us-standard, it would ask you to specify the endpoint, which cause the code to fail.

How to reproduce, create a bucket using none us standard, and try upload using the code.

tpyo added a commit that referenced this pull request Jun 11, 2013
@tpyo
Copy link
Owner

tpyo commented Jun 11, 2013

Thanks for reporting this. Apologies for the delayed fix.

@tpyo tpyo closed this Jun 11, 2013
aotd1 pushed a commit to aotd1/amazon-s3-php-class that referenced this pull request Oct 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants