]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Memcached_DataObject::pkeyGet() accepts null values
authorEvan Prodromou <evan@status.net>
Mon, 11 Jul 2011 16:40:28 +0000 (12:40 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 11 Jul 2011 16:40:28 +0000 (12:40 -0400)
classes/Memcached_DataObject.php

index c361ba878313f0ddbf51ab0d0125d76ea6e5c6fe..0e60b7fed586ecc3143aefaff0366bda4469f950 100644 (file)
@@ -78,7 +78,13 @@ class Memcached_DataObject extends Safe_DataObject
                 return false;
             }
             foreach ($kv as $k => $v) {
-                $i->$k = $v;
+               if (is_null($v)) {
+                       // XXX: possible SQL injection...? Don't 
+                       // pass keys from the browser, eh.
+                       $i->whereAdd("$k is null");
+               } else {
+                       $i->$k = $v;
+               }
             }
             if ($i->find(true)) {
                 $i->encache();