mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 16:22:43 +01:00
Fix an exception in cursor pagination of Conpherence threads
Summary: Ref T13680. Conpherence may pass values with an integer type to this layer of the stack. These are "supposed" to be strings, but just be accepting. Test Plan: - Wrote 100+ messages to a Conpherence room. - Clicked "Show Older Messages". - Before: exception, int passed to "phutil_nonempty_string()". - After: older messages loaded. Maniphest Tasks: T13680 Differential Revision: https://secure.phabricator.com/D21824
This commit is contained in:
parent
431612023d
commit
147b48b934
1 changed files with 7 additions and 4 deletions
|
@ -369,10 +369,13 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery
|
|||
|
||||
$this->setLimit($limit + 1);
|
||||
|
||||
if (phutil_nonempty_string($pager->getAfterID())) {
|
||||
$this->setExternalCursorString($pager->getAfterID());
|
||||
} else if ($pager->getBeforeID()) {
|
||||
$this->setExternalCursorString($pager->getBeforeID());
|
||||
$after_id = phutil_string_cast($pager->getAfterID());
|
||||
$before_id = phutil_string_cast($pager->getBeforeID());
|
||||
|
||||
if (phutil_nonempty_string($after_id)) {
|
||||
$this->setExternalCursorString($after_id);
|
||||
} else if (phutil_nonempty_string($before_id)) {
|
||||
$this->setExternalCursorString($before_id);
|
||||
$this->setIsQueryOrderReversed(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue