From c31216e4930645df808577dea017642f0495989f Mon Sep 17 00:00:00 2001 From: v12mike Date: Sat, 7 Sep 2019 04:16:31 -0400 Subject: [PATCH 1/2] [ticket/16150] Make post subject link an absolute url The previous version was relative to a &start= which was sometimes wrong. PHPBB3-16150 --- phpBB/styles/prosilver/template/viewtopic_body.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 8d7e26f099..63ed2ba8d6 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -224,7 +224,7 @@
style="display: none;"> -

class="first">{postrow.POST_ICON_IMG_ALT} {postrow.POST_SUBJECT}

+

class="first">{postrow.POST_ICON_IMG_ALT} {postrow.POST_SUBJECT}

From 88d94a7c1992e43dd8300ba41352e36d3d2c6381 Mon Sep 17 00:00:00 2001 From: v12mike Date: Sun, 8 Sep 2019 14:23:09 -0400 Subject: [PATCH 2/2] [ticket/16150] Make post subject links reliable Change links that were relative to topic page into absolute links. Update related test cases. PHPBB3-16150 --- phpBB/styles/prosilver/template/mcp_topic.html | 2 +- phpBB/styles/prosilver/template/posting_review.html | 2 +- phpBB/styles/prosilver/template/posting_topic_review.html | 2 +- tests/functional/download_test.php | 2 +- tests/functional/feed_test.php | 6 +++--- tests/functional/posting_test.php | 4 ++-- tests/functional/prune_shadow_topic_test.php | 2 +- tests/functional/visibility_softdelete_test.php | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index 090e24041e..889cab8b83 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -118,7 +118,7 @@

- + {postrow.MINI_POST} {L_POSTED} {postrow.POST_DATE} {L_POST_BY_AUTHOR} {% EVENT mcp_topic_post_author_full_prepend %}{postrow.POST_AUTHOR_FULL}{% EVENT mcp_topic_post_author_full_append %} [ {L_POST_DETAILS} ]

diff --git a/phpBB/styles/prosilver/template/posting_review.html b/phpBB/styles/prosilver/template/posting_review.html index 033a88485e..e5d285e7bf 100644 --- a/phpBB/styles/prosilver/template/posting_review.html +++ b/phpBB/styles/prosilver/template/posting_review.html @@ -13,7 +13,7 @@
-

{post_review_row.POST_SUBJECT}

+

{post_review_row.POST_SUBJECT}

{post_review_row.MINI_POST} diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html index 8faece3447..209dadf327 100644 --- a/phpBB/styles/prosilver/template/posting_topic_review.html +++ b/phpBB/styles/prosilver/template/posting_topic_review.html @@ -24,7 +24,7 @@

-

{topic_review_row.POST_SUBJECT}

+

{topic_review_row.POST_SUBJECT}

    diff --git a/tests/functional/download_test.php b/tests/functional/download_test.php index e2f1d065be..3d4f316d72 100644 --- a/tests/functional/download_test.php +++ b/tests/functional/download_test.php @@ -55,7 +55,7 @@ class phpbb_functional_download_test extends phpbb_functional_test_case // Test creating a reply $post2 = $this->create_post($this->data['forums']['Download #1'], $post['topic_id'], 'Re: Download Topic #1-#2', 'This is a test post posted by the testing framework.', array('upload_files' => 1)); - $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}"); + $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); $this->assertContains('Re: Download Topic #1-#2', $crawler->filter('html')->text()); $this->data['posts']['Re: Download Topic #1-#2'] = (int) $post2['post_id']; diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php index 3792b0a23c..725a44ae5e 100644 --- a/tests/functional/feed_test.php +++ b/tests/functional/feed_test.php @@ -337,7 +337,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case // Test creating a reply $post2 = $this->create_post($this->data['forums']['Feeds #news'], $post['topic_id'], 'Re: Feeds #news - Topic #2', 'This is a test post posted by the testing framework.'); - $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}"); + $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); self::assertContains('Re: Feeds #news - Topic #2', $crawler->filter('html')->text()); $this->data['posts']['Re: Feeds #news - Topic #2'] = (int) $post2['post_id']; @@ -493,7 +493,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case // Test creating a reply $post2 = $this->create_post($this->data['forums']['Feeds #1'], $post['topic_id'], 'Re: Feeds #1 - Topic #2', 'This is a test post posted by the testing framework.'); - $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}"); + $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); self::assertContains('Re: Feeds #1 - Topic #2', $crawler->filter('html')->text()); $this->data['posts']['Re: Feeds #1 - Topic #2'] = (int) $post2['post_id']; @@ -1222,7 +1222,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case // Test creating a reply with 1 missing attachment $post2 = $this->create_post($this->data['forums']['Feeds #1'], $this->data['topics']['Feeds #1 - Topic #3'], 'Re: Feeds #1 - Topic #3-1', 'This is a test post posted by the testing framework. [attachment=0]Attachment #0[/attachment]'); - $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}"); + $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); self::assertContains('Re: Feeds #1 - Topic #3-1', $crawler->filter('html')->text()); $this->data['posts']['Re: Feeds #1 - Topic #3-1'] = (int) $post2['post_id']; diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php index 764376a945..7150f20a9d 100644 --- a/tests/functional/posting_test.php +++ b/tests/functional/posting_test.php @@ -29,7 +29,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case // Test creating a reply with bbcode $post2 = $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test [b]post[/b] posted by the testing framework.'); - $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}"); + $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); $this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text()); // Test quoting a message @@ -161,7 +161,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case { $this->set_quote_depth($quote_depth); - $post = $this->create_post(2, $topic['topic_id'], 'Re: Test Topic 1', $text); + $post = $this->create_post(2, $topic['topic_id'], "Re: Test Topic 1#$quote_depth", $text); $url = "viewtopic.php?p={$post['post_id']}&sid={$this->sid}"; $crawler = self::request('GET', $url); diff --git a/tests/functional/prune_shadow_topic_test.php b/tests/functional/prune_shadow_topic_test.php index c014119b98..2bf0280d62 100644 --- a/tests/functional/prune_shadow_topic_test.php +++ b/tests/functional/prune_shadow_topic_test.php @@ -77,7 +77,7 @@ class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_cas // Test creating a reply $post2 = $this->create_post($this->data['forums']['Prune Shadow'], $this->post['topic_id'], 'Re: Prune Shadow #1-#2', 'This is a test post posted by the testing framework.'); - $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}"); + $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); $this->assertContains('Re: Prune Shadow #1-#2', $crawler->filter('html')->text()); $this->data['posts']['Re: Prune Shadow #1-#2'] = (int) $post2['post_id']; diff --git a/tests/functional/visibility_softdelete_test.php b/tests/functional/visibility_softdelete_test.php index 6450c00c1e..fd994361a5 100644 --- a/tests/functional/visibility_softdelete_test.php +++ b/tests/functional/visibility_softdelete_test.php @@ -97,7 +97,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ // Test creating a reply $post2 = $this->create_post($this->data['forums']['Soft Delete #1'], $post['topic_id'], 'Re: Soft Delete Topic #1-#2', 'This is a test post posted by the testing framework.'); - $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}"); + $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); $this->assertContains('Re: Soft Delete Topic #1-#2', $crawler->filter('html')->text()); $this->data['posts']['Re: Soft Delete Topic #1-#2'] = (int) $post2['post_id']; @@ -114,7 +114,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ // Test creating another reply $post3 = $this->create_post($this->data['forums']['Soft Delete #1'], $post['topic_id'], 'Re: Soft Delete Topic #1-#3', 'This is another test post posted by the testing framework.'); - $crawler = self::request('GET', "viewtopic.php?t={$post3['topic_id']}&sid={$this->sid}"); + $crawler = self::request('GET', "viewtopic.php?p={$post3['post_id']}&sid={$this->sid}"); $this->assertContains('Re: Soft Delete Topic #1-#3', $crawler->filter('html')->text()); $this->data['posts']['Re: Soft Delete Topic #1-#3'] = (int) $post3['post_id'];