Commit 6736029d authored by Matthias Sommerfeld's avatar Matthias Sommerfeld

Final version 1.0

parent 5d60d205
......@@ -53,7 +53,7 @@ In older builds "ß" was mapped to "ss". Should you still need this behaviour, s
### Official ZIP Package
Go to <http://idnaconv.phlymail.de/> and follow the download link. Once downloaded and uncompressed, just copy the file `idna_convert.class.php` into your application and start using it.
Go to <http://idnaconv.net/get-it.html> for the ZIP package. Put the uncompressed files into the vendor/ dir fo your app. Then follow the examples below
## Examples
......
......@@ -47,7 +47,7 @@
*
* @author Matthias Sommerfeld <mso@phlylabs.de>
* @copyright 2004-2016 phlyLabs Berlin, http://phlylabs.de
* @version 1.0.0-dev 2016-01-08
* @version 1.0.0-main 2016-01-10
*/
namespace Mso\IdnaConvert;
......@@ -55,7 +55,7 @@ namespace Mso\IdnaConvert;
class IdnaConvert {
const Version = '1.0.0';
const SubVersion = 'dev';
const SubVersion = 'main';
// Internal settings, do not touch!
const PunycodePrefix = 'xn--';
......@@ -433,7 +433,7 @@ class IdnaConvert {
$encode_test = preg_replace('!^' . preg_quote(self::PunycodePrefix, '!') . '!', '', $encoded);
// If nothing left after removing the prefix, it is hopeless
if (!$encode_test) {
throw new \InvalidArgumentException('The given encoded string was empty');
return false;
}
// Find last occurence of the delimiter
$delim_pos = strrpos($encoded, '-');
......@@ -501,7 +501,7 @@ class IdnaConvert {
}
}
if (!$encodable) {
throw new \InvalidArgumentException('The given string does not contain encodable chars');
return false;
}
// Do NAMEPREP
$decoded = $this->_nameprep($decoded);
......
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