summaryrefslogtreecommitdiff
path: root/includes/content/CssContent.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-12-27 15:41:37 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-12-31 11:43:28 +0100
commitc1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch)
tree2b38796e738dd74cb42ecd9bfd151803108386bc /includes/content/CssContent.php
parentb88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff)
Update to MediaWiki 1.24.1
Diffstat (limited to 'includes/content/CssContent.php')
-rw-r--r--includes/content/CssContent.php28
1 files changed, 20 insertions, 8 deletions
diff --git a/includes/content/CssContent.php b/includes/content/CssContent.php
index 03cc2d00..8290603c 100644
--- a/includes/content/CssContent.php
+++ b/includes/content/CssContent.php
@@ -31,18 +31,26 @@
* @ingroup Content
*/
class CssContent extends TextContent {
- public function __construct( $text ) {
- parent::__construct( $text, CONTENT_MODEL_CSS );
+
+ /**
+ * @param string $text CSS code.
+ * @param string $modelId the content content model
+ */
+ public function __construct( $text, $modelId = CONTENT_MODEL_CSS ) {
+ parent::__construct( $text, $modelId );
}
/**
* Returns a Content object with pre-save transformations applied using
* Parser::preSaveTransform().
*
- * @param $title Title
- * @param $user User
- * @param $popts ParserOptions
- * @return Content
+ * @param Title $title
+ * @param User $user
+ * @param ParserOptions $popts
+ *
+ * @return CssContent
+ *
+ * @see TextContent::preSaveTransform
*/
public function preSaveTransform( Title $title, User $user, ParserOptions $popts ) {
global $wgParser;
@@ -51,15 +59,19 @@ class CssContent extends TextContent {
$text = $this->getNativeData();
$pst = $wgParser->preSaveTransform( $text, $title, $user, $popts );
- return new CssContent( $pst );
+ return new static( $pst );
}
+ /**
+ * @return string CSS wrapped in a <pre> tag.
+ */
protected function getHtml() {
$html = "";
$html .= "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n";
- $html .= $this->getHighlightHtml();
+ $html .= htmlspecialchars( $this->getNativeData() );
$html .= "\n</pre>\n";
return $html;
}
+
}