Skip to content

Commit

Permalink
Fix issue with memcache and domains starting with letter "u"
Browse files Browse the repository at this point in the history
  • Loading branch information
dakota committed Mar 19, 2015
1 parent 519b616 commit fdea42f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cache/Engine/MemcachedEngine.php
Expand Up @@ -241,7 +241,7 @@ protected function _setOptions()
*/
protected function _parseServerString($server)
{
if ($server[0] === 'u') {
if (strpos($server, 'unix://') === 0) {
return [$server, 0];
}
if (substr($server, 0, 1) === '[') {
Expand Down
12 changes: 12 additions & 0 deletions tests/TestCase/Cache/Engine/MemcachedEngineTest.php
Expand Up @@ -445,6 +445,18 @@ public function testConnectIpv6()
$this->assertTrue($result);
}

/**
* test domain starts with u
*
* @return void
*/
public function testParseServerStringWithU()
{
$Memcached = new TestMemcachedEngine();
$result = $Memcached->parseServerString('udomain.net:13211');
$this->assertEquals(array('udomain.net', '13211'), $result);
}

/**
* test non latin domains.
*
Expand Down

0 comments on commit fdea42f

Please sign in to comment.