Skip to content

Commit

Permalink
[ticket/13821] Remove HTML from PHP files and deduplicate lang variable
Browse files Browse the repository at this point in the history
PHPBB3-13821
  • Loading branch information
marc1706 committed Jan 22, 2022
1 parent 9f09dec commit 97356d9
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions phpBB/language/en/common.php
Expand Up @@ -603,8 +603,7 @@
'POSTS_UNAPPROVED_FORUM'=> 'At least one post in this forum has not been approved.',
'POST_BY_AUTHOR' => 'by',
'POST_BY_FOE' => '<strong>%1$s</strong>, who is currently on your ignore list, made this post.',
'POST_DISPLAY' => '%1$sDisplay this post%2$s.',
'POST_DISPLAY_TEXT' => 'Display this post',
'POST_DISPLAY' => 'Display this post',
'POST_DAY' => '%.2f posts per day',
'POST_DELETED_ACTION' => 'Deleted post:',
'POST_DELETED' => 'This post has been deleted.',
Expand Down
2 changes: 1 addition & 1 deletion phpBB/styles/prosilver/template/posting_review.html
Expand Up @@ -7,7 +7,7 @@ <h3>{L_POST_REVIEW}</h3>
<div class="post bg3 post-ignore">
<div class="inner">
{post_review_row.L_IGNORE_POST}<br>
<a class="display_post_review" href="{{ post_review_row.U_MINI_POST }}">{{ lang('POST_DISPLAY_TEXT') }}</a>
<a class="display_post_review" href="{{ post_review_row.U_MINI_POST }}">{{ lang('POST_DISPLAY') }}</a>
<!-- ELSE -->
<div class="post <!-- IF post_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
<div class="inner">
Expand Down
4 changes: 2 additions & 2 deletions phpBB/styles/prosilver/template/posting_topic_review.html
Expand Up @@ -14,12 +14,12 @@ <h3 id="review" class="review">
<div class="post bg3 post-ignore">
<div class="inner">
{topic_review_row.L_IGNORE_POST}<br>
<a class="display_post_review" href="{{ post_review_row.U_MINI_POST }}">{{ lang('POST_DISPLAY_TEXT') }}</a>
<a class="display_post_review" href="{{ post_review_row.U_MINI_POST }}">{{ lang('POST_DISPLAY') }}</a>
<!-- ELSE IF topic_review_row.S_POST_DELETED -->
<div class="post bg3 post-ignore">
<div class="inner">
{topic_review_row.L_DELETE_POST}<br>
<a class="display_post_review" href="{{ post_review_row.U_MINI_POST }}">{{ lang('POST_DISPLAY_TEXT') }}</a>
<a class="display_post_review" href="{{ post_review_row.U_MINI_POST }}">{{ lang('POST_DISPLAY') }}</a>
<!-- ELSE -->
<div class="post <!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF topic_review_row.POST_ID == REPORTED_POST_ID --> reported<!-- ENDIF -->">
<div class="inner">
Expand Down
8 changes: 4 additions & 4 deletions phpBB/styles/prosilver/template/viewtopic_body.html
Expand Up @@ -211,13 +211,13 @@ <h2 class="poll-title"><!-- EVENT viewtopic_body_poll_question_prepend -->{POLL_
<!-- IF postrow.S_POST_HIDDEN -->
<!-- IF postrow.S_POST_DELETED -->
<div class="ignore" id="post_hidden{postrow.POST_ID}">
{postrow.L_POST_DELETED_MESSAGE}<br />
{postrow.L_POST_DISPLAY}
{postrow.L_POST_DELETED_MESSAGE}<br>
<a class="display_post" data-post-id="{{ postrow.POST_ID }}" href="{{ postrow.U_MINI_POST_VIEW }}">{{ lang('POST_DISPLAY') }}</a>
</div>
<!-- ELSEIF postrow.S_IGNORE_POST -->
<div class="ignore" id="post_hidden{postrow.POST_ID}">
{postrow.L_IGNORE_POST}<br />
{postrow.L_POST_DISPLAY}
{postrow.L_IGNORE_POST}<br>
<a class="display_post" data-post-id="{{ postrow.POST_ID }}" href="{{ postrow.U_MINI_POST_VIEW }}">{{ lang('POST_DISPLAY') }}</a>
</div>
<!-- ENDIF -->
<!-- ENDIF -->
Expand Down
2 changes: 1 addition & 1 deletion phpBB/viewtopic.php
Expand Up @@ -2077,6 +2077,7 @@
'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;p=' . $row['post_id'], true, $user->session_id) : '',
'U_MCP_RESTORE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_data['topic_visibility'] != ITEM_DELETED) ? 'deleted_posts' : 'deleted_topics') . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
'U_MINI_POST_VIEW' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '&amp;view=show#p' . $row['post_id'],
'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$post_list[$i + 1]])) ? $rowset[$post_list[$i + 1]]['post_id'] : '',
'U_PREV_POST_ID' => $prev_post_id,
'U_NOTES' => ($auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $poster_id, true, $user->session_id) : '',
Expand Down Expand Up @@ -2106,7 +2107,6 @@
'S_IGNORE_POST' => ($row['foe']) ? true : false,
'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '',
'S_POST_HIDDEN' => $row['hide_post'],
'L_POST_DISPLAY' => ($row['hide_post']) ? $user->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $row['post_id'] . '" href="' . $viewtopic_url . "&amp;p={$row['post_id']}&amp;view=show#p{$row['post_id']}" . '">', '</a>') : '',
'S_DELETE_PERMANENT' => $permanent_delete_allowed,
);

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/download_test.php
Expand Up @@ -115,7 +115,7 @@ public function test_softdelete_post()
$this->assertContainsLang('POST_DELETED', $crawler->text());

$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}");
$this->assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text());
$this->assertStringContainsString($this->lang('POST_DISPLAY'), $crawler->text());
}

public function test_download_softdeleted_post()
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/feed_test.php
Expand Up @@ -532,7 +532,7 @@ public function test_softdelete_post()
self::assertContainsLang('POST_DELETED', $crawler->text());

$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}");
self::assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text());
self::assertStringContainsString($this->lang('POST_DISPLAY'), $crawler->text());
}

public function test_feeds_softdeleted_post_admin()
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/visibility_softdelete_test.php
Expand Up @@ -177,7 +177,7 @@ public function test_softdelete_post()
), 'after softdelete');

$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
$this->assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text());
$this->assertStringContainsString($this->lang('POST_DISPLAY'), $crawler->text());
}

public function test_softdelete_post_no_m_delete()
Expand Down Expand Up @@ -227,7 +227,7 @@ public function test_softdelete_post_no_m_delete()
), 'after softdelete without m_delete');

$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
$this->assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text());
$this->assertStringContainsString($this->lang('POST_DISPLAY'), $crawler->text());
}

public function test_move_softdeleted_post()
Expand Down

0 comments on commit 97356d9

Please sign in to comment.