diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
commit | c9aa36da061816dee256a979c2ff8d2ee41824d9 (patch) | |
tree | 29f7002b80ee984b488bd047dbbd80b36bf892e9 /includes/content/CssContent.php | |
parent | b4274e0e33eafb5e9ead9d949ebf031a9fb8363b (diff) | |
parent | d1ba966140d7a60cd5ae4e8667ceb27c1a138592 (diff) |
Merge branch 'archwiki'
# Conflicts:
# skins/ArchLinux.php
# skins/ArchLinux/archlogo.gif
Diffstat (limited to 'includes/content/CssContent.php')
-rw-r--r-- | includes/content/CssContent.php | 28 |
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; } + } |