[dev] [commits] Horde branch master updated. 84b0cd595d0d537811495d47ce83ff82902c1265

Michael M Slusarz slusarz at horde.org
Thu Oct 3 18:50:23 UTC 2013


Quoting "Michael J. Rubinsky" <mrubinsk at horde.org>:

> The branch "master" has been updated.
> The following is a summary of the commits.
>
> from: df6090b661783dc5eff54aaca6da359799833a54
>
> 84b0cd5 Do not force the database when one is explicitly specified.
>
> Summary:  
> http://github.com/horde/horde/compare/df6090b661783dc5eff54aaca6da359799833a54...84b0cd595d0d537811495d47ce83ff82902c1265
>
> -----------------------------------------------------------------------
>
> commit 84b0cd595d0d537811495d47ce83ff82902c1265
> Author: Michael J Rubinsky <mrubinsk at horde.org>
> Date:   Wed Oct 2 22:29:18 2013 -0400
>
>     Do not force the database when one is explicitly specified.
>
>     It is EXTREMELY dangerous to do this. E.g.,
>
>     $client = new Horde_Mongo_Client();
>
>     // This inserts into 'horde' even though you specify 'test_database'.
>     $client->test_database->my_collection->insert($document);
>
>     // This completely nukes your 'horde' database.
>     $client->test_database->drop();
>
>  framework/Mongo/lib/Horde/Mongo/Client.php |   23 +++++++++++++++--------
>  1 files changed, 15 insertions(+), 8 deletions(-)
>
> http://github.com/horde/horde/commit/84b0cd595d0d537811495d47ce83ff82902c1265
> http://git.horde.org/horde-git/-/commit/84b0cd595d0d537811495d47ce83ff82902c1265

You can't do this:

-    public function dropDB($db)
+    public function dropDB($db = null)

(selectCollection() also).  You are extending a function from a parent  
class, so the method signatures MUST match.  This throws all kinds of  
warnings in strict mode.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list