From: Marcel Werk Date: Tue, 30 Mar 2021 17:11:03 +0000 (+0200) Subject: Redirect to GET request after using the participant filter X-Git-Tag: 5.3.6~1 X-Git-Url: https://git.stricted.de/?p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.conversation.git;a=commitdiff_plain;h=85876c0f12e0865288864f29b80bb03cc001895a Redirect to GET request after using the participant filter --- diff --git a/files/lib/page/ConversationListPage.class.php b/files/lib/page/ConversationListPage.class.php index 59f7eb5..8dce6f7 100644 --- a/files/lib/page/ConversationListPage.class.php +++ b/files/lib/page/ConversationListPage.class.php @@ -7,8 +7,10 @@ use wcf\system\clipboard\ClipboardHandler; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\IllegalLinkException; use wcf\system\page\PageLocationManager; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\ArrayUtil; +use wcf\util\HeaderUtil; /** * Shows a list of conversations. @@ -122,7 +124,7 @@ class ConversationListPage extends SortablePage { // labels $this->labelList = ConversationLabel::getLabelsByUser(); - if (isset($_REQUEST['labelID'])) { + if (!empty($_REQUEST['labelID'])) { $this->labelID = intval($_REQUEST['labelID']); $validLabel = false; @@ -139,6 +141,20 @@ class ConversationListPage extends SortablePage { } if (isset($_REQUEST['participants'])) $this->participants = array_slice(ArrayUtil::trim(explode(',', $_REQUEST['participants'])), 0, 20); + + if (!empty($_POST)) { + $participantsParameter = ''; + foreach ($this->participants as $participant) { + if (!empty($participantsParameter)) $participantsParameter .= ','; + $participantsParameter .= \rawurlencode($participant); + } + if (!empty($participantsParameter)) { + $participantsParameter = '&participants=' . $participantsParameter; + } + + HeaderUtil::redirect(LinkHandler::getInstance()->getLink('ConversationList', [], 'sortField='.$this->sortField.'&sortOrder='.$this->sortOrder.'&filter='.$this->filter.'&labelID='.$this->labelID.'&pageNo='.$this->pageNo.$participantsParameter)); + exit; + } } /** @noinspection PhpMissingParentCallCommonInspection */