From d5c266d26098ad062f87eb303c38ab015f68a9dd Mon Sep 17 00:00:00 2001 From: ABRAHAM Morgan Date: Sun, 20 Nov 2016 21:54:37 +0100 Subject: [PATCH 1/3] Add test to prevent autoloader bug Not testing if $val is a string before testing if it is a subclass can cause autoloader class to abnormally load a class which match string value in include directory. --- rdb/DatumConverter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdb/DatumConverter.php b/rdb/DatumConverter.php index 055e3a9..f3d3361 100644 --- a/rdb/DatumConverter.php +++ b/rdb/DatumConverter.php @@ -34,7 +34,7 @@ public function nativeToDatum($v) if (!is_numeric($key) && !is_string($key)) { throw new RqlDriverError("Key must be a string."); } - if (is_subclass_of($val, "\\r\\Query") && !is_subclass_of($val, '\r\Datum\Datum')) { + if (!is_string($val) && is_subclass_of($val, "\\r\\Query") && !is_subclass_of($val, '\r\Datum\Datum')) { $subDatum = $val; $mustUseMakeTerm = true; } else { From 3bf14367dabd3a08095f23b43bfd307479f20ccd Mon Sep 17 00:00:00 2001 From: ABRAHAM Morgan Date: Sun, 20 Nov 2016 22:07:37 +0100 Subject: [PATCH 2/3] Update Connection.php --- rdb/Connection.php | 1 - 1 file changed, 1 deletion(-) diff --git a/rdb/Connection.php b/rdb/Connection.php index dcfdf63..5d7519c 100644 --- a/rdb/Connection.php +++ b/rdb/Connection.php @@ -271,7 +271,6 @@ public function run(Query $query, $options = array(), &$profile = '') } else { return $this->createCursorFromResponse($response, $token, $response['n'], $toNativeOptions); } - } public function continueQuery($token) From 95b86ea5a84f1bb58997a83ae7b639ea1fdc4147 Mon Sep 17 00:00:00 2001 From: ABRAHAM Morgan Date: Sun, 20 Nov 2016 22:07:52 +0100 Subject: [PATCH 3/3] Update DatumConverter.php --- rdb/DatumConverter.php | 1 - 1 file changed, 1 deletion(-) diff --git a/rdb/DatumConverter.php b/rdb/DatumConverter.php index f3d3361..bde0cf0 100644 --- a/rdb/DatumConverter.php +++ b/rdb/DatumConverter.php @@ -158,7 +158,6 @@ public function canEncodeAsJson($v) } return false; - } public function wrapImplicitVar(Query $q)