arangodb / arangodb-php

PHP ODM for ArangoDB
https://www.arangodb.com
Apache License 2.0
183 stars 43 forks source link

bug; Invalid bind parameter value on "file" value #176

Closed antokara closed 9 years ago

antokara commented 9 years ago

I have an AQL that Binds a value to Filter an Attribute that matches the "file" value. The problem is that the code here: https://github.com/triAGENS/ArangoDB-PHP/blob/master/lib/triagens/ArangoDb/ValueValidator.php#L44

More specifically the part

is_callable($value)

returns true on a string containing the word "file" because it is also a php function. please note that my bind variable has been explicitly defined as string with

$variable=strval($variable);

prior binding.

Is this intended? if not, perhaps the php gettype function http://php.net/manual/en/function.gettype.php could help/replace the above line? not sure why this check is being made there.

I can successfully bind and execute an AQL with the 'file' value with arangosh/http/etc.

antokara commented 9 years ago

Ok just tested it and it works, thanks for the light speed fix. If possible, please apply to the 2.3.x branch also, thanks!

jsteemann commented 9 years ago

Thanks for the hint. The behavior was of course unintentional. It should have been fixed now in the 2.3, 2.4 and devel branches of the driver. The should also be new tags.

antokara commented 9 years ago

Did a composer update with require "triagens/arangodb": "2.3.x-dev" but did not get it.

antokara commented 9 years ago

update, just got the 2.3.x thanks!