Changeset 694 for trunk/lib


Ignore:
Timestamp:
Aug 8, 2019 9:58:42 PM (5 years ago)
Author:
anonymous
Message:

Fix cases when checking for current lock was missing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Lock.inc.php

    r690 r694  
    185185     * @param string $record_key  The key column for the record to lock.
    186186     * @param string $record_val  The value of the key column for the record to lock.
    187      * @param string $title       A title to apply to the lock, for display purposes.
    188187     */
    189188    public function select($record_table_or_lock_id, $record_key=null, $record_val=null)
     
    245244        $this->initDB();
    246245
    247         if (isset($this->data['lock_id'])) {
     246        if ($this->isLocked()) {
    248247            $qid = $db->query("SELECT * FROM " . $db->escapeString($this->getParam('db_table')) . " WHERE lock_id = '" . $db->escapeString($this->data['lock_id']) . "'");
    249248            if ($lock = mysql_fetch_assoc($qid)) {
     
    328327        $this->_auto_timeout();
    329328
     329        if (!$this->isLocked()) {
     330            // No lock selected.
     331            return false;
     332        }
     333
    330334        // Delete a specific lock.
    331335        $db->query("
     
    335339
    336340        $app->logMsg(sprintf('Removing lock: %s', $this->data['lock_id']), LOG_DEBUG, __FILE__, __LINE__);
     341        return true;
    337342    }
    338343
Note: See TracChangeset for help on using the changeset viewer.