SpecialLinkSearch: clean up munged query variable handling
[lhc/web/wiklou.git] / includes / content / JavaScriptContent.php
index 442b705..c0194c2 100644 (file)
@@ -34,9 +34,10 @@ class JavaScriptContent extends TextContent {
 
        /**
         * @param string $text JavaScript code.
+        * @param string $modelId the content model name
         */
-       public function __construct( $text ) {
-               parent::__construct( $text, CONTENT_MODEL_JAVASCRIPT );
+       public function __construct( $text, $modelId = CONTENT_MODEL_JAVASCRIPT ) {
+               parent::__construct( $text, $modelId );
        }
 
        /**
@@ -57,7 +58,7 @@ class JavaScriptContent extends TextContent {
                $text = $this->getNativeData();
                $pst = $wgParser->preSaveTransform( $text, $title, $user, $popts );
 
-               return new JavaScriptContent( $pst );
+               return new static( $pst );
        }
 
        /**