-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Redis ressource manager shouldn't check server not starting with '/' #6584
Comments
@steeve-christen could you convert this into a failing test case? I do not understand the consequences of what you are reporting: why is that check wrong? |
If you give a server address without port (example.com), the test return true and try to parse the url
Error message would then be:
It isn't the problem of a slash, but that the port is missing, isn't it? Thank's for your answer. |
When I use your suggestion (example.com) all works fine with this testcase: public function testSetServerWithoutPort()
{
$dummyResId = '1234567890';
$server = 'redis://example.com';
$this->resourceManager->setServer($dummyResId, $server);
$server = $this->resourceManager->getServer($dummyResId);
$this->assertEquals('example.com', $server['host']);
} You are using the latest version of ZF2 (2.3.2)? I see the parsing of the url is updated in the latest release via PR #6495. |
I meant, if you use just example.com as bellow
Then, the test return true and try to parse the url which doesn't return a host:
return:
Yes I'm using 2.3.2. |
This issue has been closed as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html |
In library/Zend/Cache/Storage/Adapter/RedisResourceManager.php on line 196, the normalize server function check if the server doesn't start with a slash.
Shouldn't it better check if there is a slash in the server variable?
The text was updated successfully, but these errors were encountered: