ZF-7029: Zend_Service_Amazon_S3 - Incorrect IP address matching in createBucket method


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.


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]?)


Assigning to Stas.

Fixed, thanks.