Skip to content

Commit 2b082c0

Browse files
committed
Fixed getTag() and optimized getcorrespondingTag()
1 parent d08dd9d commit 2b082c0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Backend/TagUtils.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function getTag($id) {
122122
->prepare('SELECT * FROM ' . $this->table . ' WHERE (type ="sHtml5Start" OR type = "sHtml5End") AND id = ?')
123123
->execute($id);
124124

125-
return ($item->numRows() > 0) ? $item : null;
125+
return ($item->numRows > 0) ? $item : null;
126126
}
127127

128128
/**
@@ -134,9 +134,9 @@ public function getcorrespondingTag(Result $item)
134134
{
135135
$type = $this->matchingTags[$item->type];
136136
$result = \Database::getInstance()
137-
->prepare('SELECT * FROM ' . $this->table . ' WHERE sh5_pid = ? AND type = ?')
138-
->execute($item->sh5_pid, $type);
139-
137+
->prepare('SELECT * FROM ' . $this->table . ' WHERE pid = ? AND sh5_pid = ? AND type = ?')
138+
->execute($item->pid, $item->sh5_pid, $type);
139+
140140
return ($result->numRows == 0) ? null : $result;
141141
}
142142

0 commit comments

Comments
 (0)