Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirector: Make "legacy" query param work #11140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/Redirector/class.redirector.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public function filenameRedirect($Filename, $Get) {
$CommentModel = new CommentModel();
// If a legacy slug is provided (assigned during a merge), attempt to lookup the comment using it
if (isset($Get['legacy']) && Gdn::structure()->table('Comment')->columnExists('ForeignID')) {
$Comment = $CommentModel->getWhere(['ForeignID' => $Vars['CommentID']])->firstRow();
$Comment = $CommentModel->getWhere(['ForeignID' => $Get['legacy'] . '-' . $Vars['CommentID']])->firstRow();

} else {
$Comment = $CommentModel->getID($Vars['CommentID']);
Expand All @@ -274,7 +274,7 @@ public function filenameRedirect($Filename, $Get) {
if (is_numeric($DiscussionID)) {
// If a legacy slug is provided (assigned during a merge), attempt to lookup the discussion using it
if (isset($Get['legacy']) && Gdn::structure()->table('Discussion')->columnExists('ForeignID') && $Filename !== 't5') {
$Discussion = $DiscussionModel->getWhere(['ForeignID' => $DiscussionID])->firstRow();
$Discussion = $DiscussionModel->getWhere(['ForeignID' => $Get['legacy'] . '-' . $DiscussionID])->firstRow();
} else {
$Discussion = $DiscussionModel->getID($Vars['DiscussionID']);
}
Expand Down