Index: trunk/phase3/includes/ConcurrencyCheck.php |
— | — | @@ -103,7 +103,7 @@ |
104 | 104 | array( |
105 | 105 | 'cc_resource_type' => $this->resourceType, |
106 | 106 | 'cc_record' => $record, |
107 | | - '(cc_user = ' . $userId . ' OR cc_expiration <= ' . wfTimestamp( TS_MW ) . ')', // only the owner can perform a checkin |
| 107 | + '(cc_user = ' . $userId . ' OR cc_expiration <= ' . $dbw->addQuotes(wfTimestamp( TS_MW )) . ')', // only the owner can perform a checkin |
108 | 108 | ), |
109 | 109 | __METHOD__, |
110 | 110 | array() |
— | — | @@ -126,7 +126,7 @@ |
127 | 127 | // this was a cache miss. populate the cache with data from the db. |
128 | 128 | // cache is set to expire at the same time as the checkout, since it'll become invalid then anyway. |
129 | 129 | // inside this transaction, a row-level lock is established which ensures cache concurrency |
130 | | - $wgMemc->set( $cacheKey, array( 'userId' => $row->cc_user, 'expiration' => $row->cc_expiration ), wfTimestamp( TS_UNIX, $row->cc_expiration ) - time() ); |
| 130 | + $wgMemc->set( $cacheKey, array( 'userId' => $row->cc_user, 'expiration' => wfTimestamp( TS_UNIX, $row->cc_expiration ) ), wfTimestamp( TS_UNIX, $row->cc_expiration ) - time() ); |
131 | 131 | $dbw->rollback(); |
132 | 132 | return false; |
133 | 133 | } |
— | — | @@ -286,8 +286,8 @@ |
287 | 287 | // safe to store values since this is inside the transaction |
288 | 288 | $wgMemc->set( |
289 | 289 | wfMemcKey( 'concurrencycheck', $this->resourceType, $record['cc_record'] ), |
290 | | - array( 'userId' => $record['cc_user'], 'expiration' => $record['cc_expiration'] ), |
291 | | - $record['cc_expiration'] - time() |
| 290 | + array( 'userId' => $record['cc_user'], 'expiration' => wfTimestamp( TS_UNIX, $record['cc_expiration'] ) ), |
| 291 | + wfTimestamp( TS_UNIX, $record['cc_expiration'] ) - time() |
292 | 292 | ); |
293 | 293 | } |
294 | 294 | } |