summaryrefslogtreecommitdiff
path: root/includes/content/CssContentHandler.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /includes/content/CssContentHandler.php
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'includes/content/CssContentHandler.php')
-rw-r--r--includes/content/CssContentHandler.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/includes/content/CssContentHandler.php b/includes/content/CssContentHandler.php
index b2a8676b..ae5f742a 100644
--- a/includes/content/CssContentHandler.php
+++ b/includes/content/CssContentHandler.php
@@ -39,4 +39,23 @@ class CssContentHandler extends CodeContentHandler {
protected function getContentClass() {
return 'CssContent';
}
+
+ public function supportsRedirects() {
+ return true;
+ }
+
+ /**
+ * Create a redirect that is also valid CSS
+ *
+ * @param Title $destination
+ * @param string $text ignored
+ * @return CssContent
+ */
+ public function makeRedirectContent( Title $destination, $text = '' ) {
+ // The parameters are passed as a string so the / is not url-encoded by wfArrayToCgi
+ $url = $destination->getFullURL( 'action=raw&ctype=text/css', false, PROTO_RELATIVE );
+ $class = $this->getContentClass();
+ return new $class( '/* #REDIRECT */@import ' . CSSMin::buildUrlValue( $url ) . ';' );
+ }
+
}