Zend Framework

Zend_Validate_Hostname incorrect local network name errors

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.5.1
  • Fix Version/s: 1.6.0
  • Component/s: Zend_Validate
  • Labels:
    None

Description

Using the Zend_Validate_Hostname with the default setting of not allowing local hostnames will produce incorrect errors when given an invalid local network name such as machine_local:

1. The isValid() method on line 413 checks if the hostname is a valid local network name and correctly sets an error if not.
2. Regardless of the result above, line 418 does a check if local names are allowed at all and so also sets an error.
3. The result is these errors, both of which cannot be correct simultaneously:

  • 'machine_local' does not appear to be a valid local network name
  • 'machine_local' appears to be a local network name but local network names are not allowed

Attached is a patch to correct line 418 from

if (!$allowLocal)

to

if ($status && !$allowLocal)

Activity

Hide
Joakim Nygård added a comment -

Trivial patch to correct issue described

Show
Joakim Nygård added a comment - Trivial patch to correct issue described
Hide
Joakim Nygård added a comment -

Fixed in r9195

Show
Joakim Nygård added a comment - Fixed in r9195
Hide
Darby Felton added a comment -

Marked as fixed for next minor release pending merge of changes to release-1.5 branch.

Show
Darby Felton added a comment - Marked as fixed for next minor release pending merge of changes to release-1.5 branch.
Hide
Joakim Nygård added a comment -

Merged to 1.5 branch in r9432

Show
Joakim Nygård added a comment - Merged to 1.5 branch in r9432
Hide
Wil Sinclair added a comment -

Updating for the 1.6.0 release.

Show
Wil Sinclair added a comment - Updating for the 1.6.0 release.

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: