Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: added missing escaping of strings
  • Loading branch information
thorsten committed Nov 4, 2022
1 parent eff4fce commit e8451b1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions phpmyfaq/src/phpMyFAQ/Attachment/AttachmentAbstract.php
Expand Up @@ -284,14 +284,14 @@ public function saveMeta(): int
$attachmentTableName,
$this->id,
$this->recordId,
$this->recordLang,
$this->realHash,
$this->virtualHash,
$this->passwordHash,
$this->filename,
$this->db->escape($this->recordLang),
$this->db->escape($this->realHash),
$this->db->escape($this->virtualHash),
$this->db->escape($this->passwordHash),
$this->db->escape($this->filename),
$this->filesize,
$this->encrypted ? 1 : 0,
$this->mimeType
$this->db->escape($this->mimeType)
);

$this->db->query($sql);
Expand Down Expand Up @@ -332,7 +332,7 @@ protected function postUpdateMeta(): void
mime_type = '%s'
WHERE id = %d",
Database::getTablePrefix(),
$this->virtualHash,
$this->db->escape($this->virtualHash),
$this->readMimeType(),
$this->id
);
Expand Down Expand Up @@ -404,7 +404,7 @@ protected function linkedRecords(): bool
$sql = sprintf(
"SELECT COUNT(1) AS count FROM %sfaqattachment WHERE virtual_hash = '%s'",
Database::getTablePrefix(),
$this->virtualHash
$this->db->escape($this->virtualHash),
);

$result = $this->db->query($sql);
Expand Down

0 comments on commit e8451b1

Please sign in to comment.