Procházet zdrojové kódy

Don’t pass projection field through to mongod if it’s an empty array

Rob Williams před 8 roky
rodič
revize
ba5ea5da94
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      lib/Alcaeus/MongoDbAdapter/AbstractCursor.php

+ 1 - 1
lib/Alcaeus/MongoDbAdapter/AbstractCursor.php

@@ -276,7 +276,7 @@ abstract class AbstractCursor
             $converter = 'convert' . ucfirst($option);
             $value = method_exists($this, $converter) ? $this->$converter() : $this->$option;
 
-            if ($value === null) {
+            if ($value === null || ($option === 'projection' && $value === [])) {
                 continue;
             }