Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/query/ConpherenceThreadQuery.php
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | if ($conpherences) { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
return $conpherences; | return $conpherences; | ||||
} | } | ||||
protected function buildGroupClause(AphrontDatabaseConnection $conn_r) { | protected function buildGroupClause(AphrontDatabaseConnection $conn_r) { | ||||
if ($this->participantPHIDs !== null || strlen($this->fulltext)) { | if ($this->participantPHIDs !== null || | ||||
phutil_nonempty_string($this->fulltext)) { | |||||
valerio.bozzolan: jackie_chan_wtf
OH NO | |||||
Done Inline Actions✅ I logged this locally and it seems this is just the user query for fulltext search, and its input domain is just NULL or string. The phutil_nonempty_string() will report alien values and this is OK. valerio.bozzolan: ✅ I logged this locally and it seems this is just the user query for fulltext search, and its… | |||||
return qsprintf($conn_r, 'GROUP BY thread.id'); | return qsprintf($conn_r, 'GROUP BY thread.id'); | ||||
} else { | } else { | ||||
return $this->buildApplicationSearchGroupClause($conn_r); | return $this->buildApplicationSearchGroupClause($conn_r); | ||||
} | } | ||||
} | } | ||||
protected function buildJoinClauseParts(AphrontDatabaseConnection $conn) { | protected function buildJoinClauseParts(AphrontDatabaseConnection $conn) { | ||||
$joins = parent::buildJoinClauseParts($conn); | $joins = parent::buildJoinClauseParts($conn); | ||||
if ($this->participantPHIDs !== null) { | if ($this->participantPHIDs !== null) { | ||||
$joins[] = qsprintf( | $joins[] = qsprintf( | ||||
$conn, | $conn, | ||||
'JOIN %T p ON p.conpherencePHID = thread.phid', | 'JOIN %T p ON p.conpherencePHID = thread.phid', | ||||
id(new ConpherenceParticipant())->getTableName()); | id(new ConpherenceParticipant())->getTableName()); | ||||
} | } | ||||
if (strlen($this->fulltext)) { | if (phutil_nonempty_string($this->fulltext)) { | ||||
Done Inline Actions✅ I logged this locally and it seems this is just the user query for fulltext search, and its input domain is just NULL or string. The phutil_nonempty_string() will report alien values and this is OK. valerio.bozzolan: ✅ I logged this locally and it seems this is just the user query for fulltext search, and its… | |||||
$joins[] = qsprintf( | $joins[] = qsprintf( | ||||
$conn, | $conn, | ||||
'JOIN %T idx ON idx.threadPHID = thread.phid', | 'JOIN %T idx ON idx.threadPHID = thread.phid', | ||||
id(new ConpherenceIndex())->getTableName()); | id(new ConpherenceIndex())->getTableName()); | ||||
} | } | ||||
// See note in buildWhereClauseParts() about this optimization. | // See note in buildWhereClauseParts() about this optimization. | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
if ($this->participantPHIDs !== null) { | if ($this->participantPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'p.participantPHID IN (%Ls)', | 'p.participantPHID IN (%Ls)', | ||||
$this->participantPHIDs); | $this->participantPHIDs); | ||||
} | } | ||||
if (strlen($this->fulltext)) { | if (phutil_nonempty_string($this->fulltext)) { | ||||
Done Inline Actions✅ I logged this locally and it seems this is just the user query for fulltext search, and its input domain is just NULL or string. The phutil_nonempty_string() will report alien values and this is OK. valerio.bozzolan: ✅ I logged this locally and it seems this is just the user query for fulltext search, and its… | |||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'MATCH(idx.corpus) AGAINST (%s IN BOOLEAN MODE)', | 'MATCH(idx.corpus) AGAINST (%s IN BOOLEAN MODE)', | ||||
$this->fulltext); | $this->fulltext); | ||||
} | } | ||||
return $where; | return $where; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
OH NO