Commit ffecca76 authored by mso's avatar mso

Version 0.8.1 - 2013-09-25

git-svn-id: svn+ssh://85.214.81.201/srv/svn/repos/idna_convert/trunk@3164 35e3bc58-21ef-11dd-9788-dfbd14258a26
parent dedc164e
......@@ -4,7 +4,7 @@
* *
* http://idnaconv.phlymail.de mailto:phlymail@phlylabs.de *
*******************************************************************************
* (c) 2004-2011 phlyLabs, Berlin *
* (c) 2004-2013 phlyLabs, Berlin *
* This file is encoded in UTF-8 *
*******************************************************************************
......
......@@ -109,15 +109,15 @@ h5 {margin:0;font-size:11pt;font-weight:bold;}
<tbody>
<tr>
<td align="right">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<input type="text" name="decoded" value="<?php echo htmlentities($decoded, null, 'UTF-8'); ?>" size="48" maxlength="255" /><br />
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'); ?>" method="get">
<input type="text" name="decoded" value="<?php echo htmlspecialchars($decoded, ENT_QUOTES, 'UTF-8'); ?>" size="48" maxlength="255" /><br />
<?php echo $version_select; ?>
<input type="submit" name="encode" value="Encode &gt;&gt;" /><?php echo $add; ?>
</form>
</td>
<td align="left">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<input type="text" name="encoded" value="<?php echo htmlentities($encoded, null, 'UTF-8'); ?>" size="48" maxlength="255" /><br />
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'); ?>" method="get">
<input type="text" name="encoded" value="<?php echo htmlspecialchars($encoded, ENT_QUOTES, 'UTF-8'); ?>" size="48" maxlength="255" /><br />
<input type="submit" name="decode" value="&lt;&lt; Decode" /><?php echo $add; ?>
</form>
</td>
......@@ -125,7 +125,7 @@ h5 {margin:0;font-size:11pt;font-weight:bold;}
</tbody>
</table>
<br />
<span id="copy">Version used: 0.8.0; &copy; 2004-2011 phlyLabs Berlin; part of <a href="http://phlymail.com/">phlyMail</a></span>
<span id="copy">Version used: 0.8.1; &copy; 2004-2013 phlyLabs Berlin; part of <a href="http://phlymail.com/">phlyMail</a></span>
</div>
</body>
</html>
\ No newline at end of file
......@@ -48,7 +48,7 @@
*
* @author Matthias Sommerfeld <mso@phlylabs.de>
* @copyright 2004-2011 phlyLabs Berlin, http://phlylabs.de
* @version 0.8.0 2011-03-11
* @version 0.8.1 2011-12-19
*/
class idna_convert
{
......@@ -780,6 +780,9 @@ class idna_convert
protected function _combine($input)
{
$inp_len = count($input);
if (0 == $inp_len) {
return false;
}
foreach (self::$NP['replacemaps'] as $np_src => $np_target) {
if ($np_target[0] != $input[0]) continue;
if (count($np_target) != $inp_len) continue;
......@@ -904,8 +907,6 @@ class idna_convert
$output .= chr(224+($v >> 12)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63));
} elseif ($v < (1 << 21)) { // 4 bytes
$output .= chr(240+($v >> 18)).chr(128+(($v >> 12) & 63)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63));
} elseif (self::$safe_mode) {
$output .= self::$safe_char;
} else {
$this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k);
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment