Skip to content

1.43 Patches

夕舞八弦 edited this page Oct 21, 2025 · 1 revision
  1. 允许在wikitext里面写img
    https://gerrit.wikimedia.org/r/c/mediawiki/core/+/994116
    https://gerrit.wikimedia.org/r/q/4c6898362353aef5d4971ae8d1910bb6d0a30e6a
commit cd0ab6e29574732b7a64a8c1da9956d7890795d7
Author: StarHeartHunt <starheart233@gmail.com>
Date:   Sun Oct 19 17:30:33 2025 +0800

    fix: re-enable mediawiki img

diff --git a/includes/parser/Sanitizer.php b/includes/parser/Sanitizer.php
index d24de469945..26c02c4af65 100644
--- a/includes/parser/Sanitizer.php
+++ b/includes/parser/Sanitizer.php
@@ -175,7 +175,8 @@ class Sanitizer {
 			# $htmlsingleonly, a self-closed tag will be emitted as
 			# an empty element (open-tag/close-tag pair).
 			$htmlsingle = [
-				'br', 'wbr', 'hr', 'li', 'dt', 'dd', 'meta', 'link'
+				'br', 'wbr', 'hr', 'li', 'dt', 'dd', 'meta', 'link',
+				'img' // https://gerrit.wikimedia.org/r/c/mediawiki/core/+/994116
 			];
 
 			# Elements that cannot have close tags. This is (not coincidentally)
@@ -184,7 +185,8 @@ class Sanitizer {
 			# a self-closing tag like <br/> is not an HTML 5 parse error only
 			# for this list.
 			$htmlsingleonly = [
-				'br', 'wbr', 'hr', 'meta', 'link'
+				'br', 'wbr', 'hr', 'meta', 'link',
+				'img' // https://gerrit.wikimedia.org/r/c/mediawiki/core/+/994116
 			];
 
 			$htmlnest = [ # Tags that can be nested--??
commit fa4fe0084369dbf39d6b3a4266370ae27065364b
Author: StarHeartHunt <starheart233@gmail.com>
Date:   Sun Oct 19 17:02:13 2025 +0800

    fix: RemexCompatFormatter: Don't encode HTML entities in raw-text elements
    
    https://github.com/wikimedia/mediawiki/commit/fc5f2119b00a616d0c38fadbd594af9140db7c6f

diff --git a/includes/tidy/RemexCompatFormatter.php b/includes/tidy/RemexCompatFormatter.php
index b1cd898674e..c5147c30158 100644
--- a/includes/tidy/RemexCompatFormatter.php
+++ b/includes/tidy/RemexCompatFormatter.php
@@ -56,10 +56,11 @@ class RemexCompatFormatter extends HtmlFormatter {
 			if ( $this->textProcessor !== null ) {
 				$text = call_user_func( $this->textProcessor, $text );
 			}
+
+			// Ensure a consistent representation for all entities
+			$text = Sanitizer::normalizeCharReferences( $text );
 		}
 
-		// Ensure a consistent representation for all entities
-		$text = Sanitizer::normalizeCharReferences( $text );
 		return $text;
 	}
 
  1. 允许img有loading属性
commit fc5abbd3aaa0d59cee6e423f4a1e65c5e310883e
Author: 夕舞八弦 <1677759063@qq.com>
Date:   Sun Oct 19 21:45:00 2025 +0800

    fix: load img has attribute loading

diff --git a/includes/parser/Sanitizer.php b/includes/parser/Sanitizer.php
index 26c02c4af65..71d8ee44373 100644
--- a/includes/parser/Sanitizer.php
+++ b/includes/parser/Sanitizer.php
@@ -1544,7 +1544,7 @@ class Sanitizer {
 			# 13.2
 			# Not usually allowed, but may be used for extension-style hooks
 			# such as <math> when it is rasterized
-			'img'        => $merge( $common, [ 'alt', 'src', 'width', 'height', 'srcset' ] ),
+			'img'        => $merge( $common, [ 'alt', 'src', 'width', 'height', 'srcset', 'loading' ] ),
 			# Attributes for A/V tags added in T163583 / T133673
 			'audio'      => $merge( $common, [ 'controls', 'preload', 'width', 'height' ] ),
 			'video'      => $merge( $common, [ 'poster', 'controls', 'preload', 'width', 'height' ] ),
  1. Sentry
commit aa097d6eb1aeea62b9c73331c3cf9179da5c9837
Author: 夕舞八弦 <1677759063@qq.com>
Date:   Tue Oct 21 20:09:23 2025 +0800

    feat: add back sentry transaction collect

diff --git a/includes/MediaWikiEntryPoint.php b/includes/MediaWikiEntryPoint.php
index b6412f4935a..6dc162abe2e 100644
--- a/includes/MediaWikiEntryPoint.php
+++ b/includes/MediaWikiEntryPoint.php
@@ -194,6 +194,9 @@ abstract class MediaWikiEntryPoint {
 	 * prepareForOutput(), and postOutputShutdown().
 	 */
 	final public function run() {
+		$transactionContext = \Sentry\Tracing\TransactionContext::make()->setName('run');
+		$transaction = \Sentry\startTransaction($transactionContext);
+
 		$this->setup();
 
 		try {
@@ -207,6 +210,8 @@ abstract class MediaWikiEntryPoint {
 		}
 
 		$this->postOutputShutdown();
+
+		$transaction->finish();
 	}
 
 	/**

Clone this wiki locally