EBernhardson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/95567


Change subject: Always return unformatted content for unformatted posts
......................................................................

Always return unformatted content for unformatted posts

Prevents accidently requesting the wrong type of content, when
only one type of content should ever be available.

Bug: 57063
Change-Id: I1920f80be8f2df264aca929a1e3060e286c9536a
---
M includes/Model/AbstractRevision.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/67/95567/1

diff --git a/includes/Model/AbstractRevision.php 
b/includes/Model/AbstractRevision.php
index d2767c9..c8f4268 100644
--- a/includes/Model/AbstractRevision.php
+++ b/includes/Model/AbstractRevision.php
@@ -279,6 +279,9 @@
         * @return string
         */
        public function getContent( $format = 'html' ) {
+               if ( !$this->isFormatted() ) {
+                       return $this->getContentRaw();
+               }
                if ( !isset( $this->convertedContent[$format] ) ) {
                        // check how content is stored & convert to requested 
format
                        $sourceFormat = in_array( 'html', $this->flags ) ? 
'html' : 'wikitext';

-- 
To view, visit https://gerrit.wikimedia.org/r/95567
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1920f80be8f2df264aca929a1e3060e286c9536a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to