Jack Phoenix has uploaded a new change for review.

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

Change subject: Catch self-closing comments and vote tags in 
BlogPage::getBlurb()
......................................................................

Catch self-closing comments and vote tags in BlogPage::getBlurb()

So that Special:ArticleLists etc. won't render <comments /> in the blurb.

Change-Id: I98bda32ad2e8e76bac71f2071ec1a1183f4abd9e
---
M BlogPage.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlogPage 
refs/changes/89/225689/1

diff --git a/BlogPage.php b/BlogPage.php
index c51cfcb..216bfb0 100644
--- a/BlogPage.php
+++ b/BlogPage.php
@@ -1103,7 +1103,9 @@
                $text = preg_replace( '@<youtube[^>]*?>.*?</youtube>@si', '', 
$text ); // <youtube> tags (provided by YouTube extension)
                $text = preg_replace( '@<video[^>]*?>.*?</video>@si', '', $text 
); // <video> tags (provided by Video extension)
                $text = preg_replace( '@<comments[^>]*?>.*?</comments>@si', '', 
$text ); // <comments> tags (provided by Comments extension)
+               $text = preg_replace( '@<comments[^>]*?\/>@si', '', $text ); // 
more of the above -- this catches the self-closing variant, <comments />
                $text = preg_replace( '@<vote[^>]*?>.*?</vote>@si', '', $text 
); // <vote> tags (provided by Vote extension)
+               $text = preg_replace( '@<vote[^>]*?\/>@si', '', $text ); // 
more of the above -- this catches the self-closing variant, <vote />, although 
it's unlikely to ever be present in the body of a blog post
                if ( class_exists( 'Video' ) ) {
                        $videoNS = $wgContLang->getNsText( NS_VIDEO );
                        if ( $videoNS === false ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I98bda32ad2e8e76bac71f2071ec1a1183f4abd9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlogPage
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <j...@countervandalism.net>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to