Memcached_DataObject::pkeyGet() accepts null values

This commit is contained in:
Evan Prodromou 2011-07-11 12:40:28 -04:00
parent 641749453d
commit 5c963cb3b7

View 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();