|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-01-03 21:14 UTC] simonsimcity at gmail dot com
Description:
------------
Currently the documentation for the function idn_to_ascii describes the first parameter as following:
>> Domain to convert. In PHP 5 must be UTF-8 encoded.
The truth is that this value do not have to be encoded in UTF-8. The encoding of this string depends on the setting of idn.default_charset
This setting by default is set to ISO-8891-1 and therefore a string containing a utf8-encoded character that's invalid in ISO-8891-1 will cause the parser to crash (ending up in an "segmentation fault" message).
Try the test-script once with the ini-value idn.default_charset of "ISO-8891-1" and once of "utf-8". Using the default-value (iso-8891-1) the script will break and using "utf-8" instead it will work as expected.
Test script:
---------------
<?php
var_dump( idn_to_ascii('ә') );
echo "123";
Expected result:
----------------
PHP Notice: IDN_IDNA_TO_ASCII: Could not convert from IDNA to ASCII in /var/www/index.php on line 1
123
Actual result:
--------------
PHP Notice: IDN_IDNA_TO_ASCII: Could not convert from IDNA to ASCII in /var/www/index.php on line 1
Segmentation fault
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 03:00:01 2025 UTC |
Same by me Debian 6 (squeeze) # php -v PHP 5.3.3-7+squeeze15 with Suhosin-Patch (cli) (built: Mar 4 2013 13:11:17) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with XCache v1.3.0, Copyright (c) 2005-2009, by mOo with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH Any good news about this problem?