Poke has uploaded a new change for review.
https://gerrit.wikimedia.org/r/61283
Change subject: Prefix wiki-text redirects with colon
......................................................................
Prefix wiki-text redirects with colon
Prefixing redirect target links with a colon will not affect the redirect
capability itself at all. However when the redirect is not processed for
certain reasons, the leading colon will prevent linked image from being
displayed.
For example when moving an image in the File namespace, the created
redirect will be this:
#redirect [[File:New name.ext]]
Now consider that someone tags this redirect page for deletion by adding a
deletion template to it (in front of the redirect code). The resulting
content would be for example this:
{{delete}}
#redirect [[File:New name.ext]]
In that case, the redirect is not handled (as it's not the first thing on
the page) but rendered as an ordered list. And in that list, the image
link will make the image being displayed, eventually causing display
issues (e.g. for large images).
By prefixing the redirect link with a colon by default, this behavior is
prevented because when interpreted as a list, the image link will be just
a *link* to the image page. When the page is not modified in such a way,
then the redirect will still work as expected with a leading colon.
Change-Id: Ie9c55f6f5cc77a7e5653a6bf9e9d2a795e804410
---
M includes/content/WikitextContentHandler.php
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/83/61283/1
diff --git a/includes/content/WikitextContentHandler.php
b/includes/content/WikitextContentHandler.php
index e1dcc66..1d32607 100644
--- a/includes/content/WikitextContentHandler.php
+++ b/includes/content/WikitextContentHandler.php
@@ -60,7 +60,7 @@
*/
public function makeRedirectContent( Title $destination ) {
$mwRedir = MagicWord::get( 'redirect' );
- $redirectText = $mwRedir->getSynonym( 0 ) . ' [[' .
$destination->getPrefixedText() . ']]';
+ $redirectText = $mwRedir->getSynonym( 0 ) . ' [[:' .
$destination->getPrefixedText() . ']]';
return new WikitextContent( $redirectText );
}
--
To view, visit https://gerrit.wikimedia.org/r/61283
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9c55f6f5cc77a7e5653a6bf9e9d2a795e804410
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Poke <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits