jenkins-bot has submitted this change and it was merged.
Change subject: Display topic title as plaintext on history page
......................................................................
Display topic title as plaintext on history page
Bug: T120329
Change-Id: I226b5a17d9af03151ba4d1e177eaa85e8e02d10b
---
M FlowActions.php
M includes/Formatter/RevisionFormatter.php
2 files changed, 34 insertions(+), 2 deletions(-)
Approvals:
Catrope: Looks good to me, approved
jenkins-bot: Verified
diff --git a/FlowActions.php b/FlowActions.php
index 4efda27..790a640 100644
--- a/FlowActions.php
+++ b/FlowActions.php
@@ -233,8 +233,8 @@
'user-links',
'user-text',
'workflow-url',
- 'wikitext',
- 'prev-wikitext',
+ 'plaintext',
+ 'prev-plaintext',
),
'class' => 'flow-history-edit-title',
),
diff --git a/includes/Formatter/RevisionFormatter.php
b/includes/Formatter/RevisionFormatter.php
index 1029e29..7336018 100644
--- a/includes/Formatter/RevisionFormatter.php
+++ b/includes/Formatter/RevisionFormatter.php
@@ -953,6 +953,38 @@
$content = $this->templating->getContent(
$previousRevision, $format );
return Message::plaintextParam( $content );
+ case 'plaintext':
+ if ( !$this->permissions->isAllowed( $revision, 'view'
) ) {
+ return '';
+ }
+
+ $format = $revision->getHtmlFormat();
+
+ $content = Utils::htmlToPlaintext(
$this->templating->getContent( $revision, $format ) );
+ return Message::plaintextParam( $content );
+
+ // This is potentially two networked round trips, much too
expensive for
+ // the rendering loop
+ case 'prev-plaintext':
+ if ( $revision->isFirstRevision() ) {
+ return '';
+ }
+ if ( $row === null ) {
+ $previousRevision =
$revision->getCollection()->getPrevRevision( $revision );
+ } else {
+ $previousRevision = $row->previousRevision;
+ }
+ if ( !$previousRevision ) {
+ return '';
+ }
+ if ( !$this->permissions->isAllowed( $previousRevision,
'view' ) ) {
+ return '';
+ }
+
+ $format = $revision->getHtmlFormat();
+
+ $content = Utils::htmlToPlaintext(
$this->templating->getContent( $previousRevision, $format ) );
+ return Message::plaintextParam( $content );
case 'workflow-url':
return $this->urlGenerator
--
To view, visit https://gerrit.wikimedia.org/r/257640
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I226b5a17d9af03151ba4d1e177eaa85e8e02d10b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sbisson <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits