Fixed missing type parameters for SQL bindValue calls

This commit is contained in:
Lukas Metzger 2018-03-27 19:51:29 +02:00
parent bac3fd1dfb
commit 852d0d6007
2 changed files with 6 additions and 6 deletions

View file

@ -239,7 +239,7 @@ class Domains
public function getDomainType(int $id) : string public function getDomainType(int $id) : string
{ {
$query = $this->db->prepare('SELECT type FROM domains WHERE id=:id'); $query = $this->db->prepare('SELECT type FROM domains WHERE id=:id');
$query->bindValue(':id', $id); $query->bindValue(':id', $id, \PDO::PARAM_INT);
$query->execute(); $query->execute();
$record = $query->fetch(); $record = $query->fetch();
@ -268,8 +268,8 @@ class Domains
} }
$query = $this->db->prepare('UPDATE domains SET master=:master WHERE id=:id'); $query = $this->db->prepare('UPDATE domains SET master=:master WHERE id=:id');
$query->bindValue(':id', $id); $query->bindValue(':id', $id, \PDO::PARAM_INT);
$query->bindValue(':master', $master); $query->bindValue(':master', $master, \PDO::PARAM_STR);
$query->execute(); $query->execute();
} }
} }

View file

@ -45,7 +45,7 @@ class Soa
$this->db->beginTransaction(); $this->db->beginTransaction();
$query = $this->db->prepare('SELECT id,name,type FROM domains WHERE id=:id'); $query = $this->db->prepare('SELECT id,name,type FROM domains WHERE id=:id');
$query->bindValue(':id', $domainId); $query->bindValue(':id', $domainId, \PDO::PARAM_INT);
$query->execute(); $query->execute();
$record = $query->fetch(); $record = $query->fetch();
@ -71,7 +71,7 @@ class Soa
]; ];
$query = $this->db->prepare('SELECT content FROM records WHERE domain_id=:id AND type=\'SOA\''); $query = $this->db->prepare('SELECT content FROM records WHERE domain_id=:id AND type=\'SOA\'');
$query->bindValue(':id', $domainId); $query->bindValue(':id', $domainId, \PDO::PARAM_INT);
$query->execute(); $query->execute();
$content = $query->fetch(); $content = $query->fetch();
@ -154,7 +154,7 @@ class Soa
public function updateSerial(int $domainId) : void public function updateSerial(int $domainId) : void
{ {
$query = $this->db->prepare('SELECT content FROM records WHERE domain_id=:id AND type=\'SOA\''); $query = $this->db->prepare('SELECT content FROM records WHERE domain_id=:id AND type=\'SOA\'');
$query->bindValue(':id', $domainId); $query->bindValue(':id', $domainId, \PDO::PARAM_INT);
$query->execute(); $query->execute();
$content = $query->fetch(); $content = $query->fetch();