aboutsummaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorMikael Nordfeldth <mmn@hethane.se>2016-01-11 19:52:33 +0100
committerMikael Nordfeldth <mmn@hethane.se>2016-01-11 19:52:33 +0100
commit93c614c184d30ae9cc199c7f020e4651392c2d7b (patch)
tree78491a55ecac258ab65fc3216b45b039a41b1559 /classes
parentc1f22f106bda268e80efd784e60171831589c535 (diff)
downloadgnu-social-93c614c184d30ae9cc199c7f020e4651392c2d7b.tar
gnu-social-93c614c184d30ae9cc199c7f020e4651392c2d7b.zip
Do updateWithKeys properly if someone would like to update PRI
Diffstat (limited to 'classes')
-rw-r--r--classes/Managed_DataObject.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/classes/Managed_DataObject.php b/classes/Managed_DataObject.php
index 7492d90978..68de8922ce 100644
--- a/classes/Managed_DataObject.php
+++ b/classes/Managed_DataObject.php
@@ -420,7 +420,7 @@ abstract class Managed_DataObject extends Memcached_DataObject
* @param DB_DataObject &$orig Must be "instanceof" $this
* @param string $pid Primary ID column (no escaping is done on column name!)
*/
- public function updateWithKeys(&$orig, $pid='id')
+ public function updateWithKeys(Managed_DataObject $orig, $pid='id')
{
if (!$orig instanceof $this) {
throw new ServerException('Tried updating a DataObject with a different class than itself.');
@@ -456,7 +456,7 @@ abstract class Managed_DataObject extends Memcached_DataObject
common_database_tablename($this->tableName()),
implode(', ', $parts),
$pid,
- $this->_quote($this->$pid));
+ $this->_quote($orig->$pid));
$result = $this->query($qry);
if ($result === false) {