Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip urldecode in indexSearch and getKeys [JIRA: CLIENTS-90] #65

Closed
Addeventure opened this issue Sep 2, 2013 · 8 comments
Closed

Skip urldecode in indexSearch and getKeys [JIRA: CLIENTS-90] #65

Addeventure opened this issue Sep 2, 2013 · 8 comments
Assignees

Comments

@Addeventure
Copy link

With urlencoding enabled in Riak HTTP API, 2i and list keys result should not be urldecoded in PHP as it then gets decoded twice:

$bucket->newBinary('hello%3Aworld', 'foobar')->setIndex('someIndex', 'bin', array('hi'))->store();
$link = reset($bucket->indexSearch('someIndex', 'bin', 'hi'));
echo $link->getKey();

This incorrectly produces "hello:world" instead of "hello%3Aworld". Simply removing urldecode (or making it an optional config value?) solves the issue.

@christophermancini
Copy link
Contributor

Are these the urldecode's that you are speaking of and is this still a problem? https://github.com/basho/riak-php-client/blob/1.4.x/src/Basho/Riak/Object.php#L907

@Basho-JIRA Basho-JIRA changed the title Skip urldecode in indexSearch and getKeys Skip urldecode in indexSearch and getKeys [JIRA: CLIENTS-90] Dec 22, 2014
@Basho-JIRA
Copy link

[~cmancini], I'm guessing this can be closed. Please confirm. Thanks.

_[posted via JIRA by Derek Somogyi]_

@christophermancini
Copy link
Contributor

No response to confirm that this is still an issue.

@Addeventure
Copy link
Author

Oops, i missed this, sorry!

I am still on riak 1.3.2 so i cannot confirm how this behaves in 1.4.x or
2.x.
Den 10 apr 2015 02:52 skrev "Christopher Mancini" <[email protected]

:

No response to confirm that this is still an issue.


Reply to this email directly or view it on GitHub
#65 (comment)
.

@christophermancini
Copy link
Contributor

Hey @Addeventure , glad you posted back. Is this still a problem for you with the 1.4.x (master branch - I say 1.4 because of the features supported, but it works with 1.3.x) of the client?

If so, I can reopen and investigate.

@Addeventure
Copy link
Author

Yes, the lines causing the issue are:
https://github.com/basho/riak-php-client/blob/1.4.x/src/Basho/Riak/Bucket.php#L393
https://github.com/basho/riak-php-client/blob/1.4.x/src/Basho/Riak/Bucket.php#L419

To reproduce, create a new object using a key like 'hello%3Aworld'. Retrieve the key using indexSearch or getKeys. The returned data will contain the key 'hello:world'

I am not sure why the urldecode is there in the first place though. Perhaps related to around problems with the deprecated "http_url_encoding" config option? I am just guessing...
Not sure if this gives any clues but the code was originally added here 771b285 when 2i support was added to the library (Nov 23, 2011).

@christophermancini
Copy link
Contributor

Alright, after we get the rewritten client released, I will investigate this for you.

@christophermancini
Copy link
Contributor

@Addeventure Can you checkout my PR and give it a 👍 if it looks good?

#98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants