History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-1083
Type: Bug Bug
Status: Resolved Resolved
Resolution: Not an Issue
Priority: Major Major
Assignee: Simon R Jones
Reporter: Philip Iezzi
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Zend_Validate_Hostname IDN validation not working

Created: 18/Mar/07 06:06 AM   Updated: 05/Jul/07 02:43 PM
Component/s: Zend_Validate
Affects Version/s: 0.9.0
Fix Version/s: 1.0.0 RC2

Time Tracking:
Not Specified

File Attachments: 1. File HostnameTestForm.php (4 kb)

Issue Links:
Related
 

Tags:
Participants: Bill Karwin, Darby Felton, Philip Iezzi and Simon R Jones


 Description  « Hide
I can't get IDN hostname validation working at all as of r4097.
$tld = 'höhö.ch';
$hostnameValidator = new Zend_Validate_Hostname();
$hostnameValidator->setValidateIdn(true); // optional as IDN validation should be enabled by default
if (!$hostnameValidator->isValid($tld)) {
    print_r($hostnameValidator->getMessages());
}

prints:

Array
(
    [0] => 'höhö.ch' appears to be a DNS hostname but cannot match against hostname schema for TLD 'ch'
    [1] => 'höhö.ch' does not appear to be a valid local network name
    [2] => 'höhö.ch' appears to be a local network name but but local network names are not allowed
)

while höhö.ch should be a valid IDN hostname.



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Bill Karwin - 19/Mar/07 03:54 PM
Assign to Darby.

Darby Felton - 19/Mar/07 04:06 PM
Deferring to Simon R Jones for initial comments.

Simon R Jones - 20/Mar/07 04:08 AM
I'll take a look into this, this may be some kind of character encoding problem

Simon R Jones - 22/Mar/07 04:13 AM
Philip,

Can you please try this script out (HostnameTestForm.php), you should access it via a web browser, and let me know if it works for you.

I have managed to replicate your problem though cannot see why its occuring at present. With UTF-8 it seems mostly down to character encoding and that can be a little tricky to pin down. The form based version above should work fine for when accepting IDN hostnames via POST


Philip Iezzi - 22/Mar/07 05:36 AM
Thanks Simon. Check out your script at:
http://web.onlime.ch/HostnameTestForm.php
It won't work. I can't tell if my editor (joe under Debian Linux) messed up the encoding of your file. ZF is a "clean" checkout of r4172, no modified files there.

Simon R Jones - 27/Mar/07 12:25 PM
Looks like the upload process messed up the character encoding. I'll put together some test scripts and give you a link to them soon so we can get to the bottom of this

Simon R Jones - 27/Mar/07 12:27 PM
Just a note that Alexander Jäger (lx at survive-linux dot com) has also reported this issue. I'll send him a link to test files too to help resolve this issue.

Philip Iezzi - 04/Jun/07 04:26 PM
Sorry about this bogus issue.
This was just a charset issue. My files were ISO-8859-1 encoded and I didn't apply utf8_encode() to the domain prior to passing it to the validator.

solution 1:
Format all your files to UTF-8

solution 2:
$tld = utf8_encode('höhö.ch');