ZF-7029: Zend_Service_Amazon_S3 - Incorrect IP address matching in createBucket method
Description
The regular expression used by the createBucket method to detect an IP address is incorrect. The period characters in the regular expression are not escaped causing detection of one or more numeric digits followed by any character.
Example:
createBucket detects a match and throws an exception when passed the bucket name bf6a1588-48ce-4900-9a62-7d08eab1a02f
Possible Solutions:
The current regular expression should have period characters escaped like so: (\d+).(\d+).(\d+).(\d+)
Use a much more complex regular expression to detect all 4 numbers in the IP address are in the range 0..255: (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2009-06-16T14:49:02.000+0000
Assigning to Stas.
Posted by Stanislav Malyshev (stas) on 2009-06-17T14:05:33.000+0000
Fixed, thanks.