Merge "Warn if stateful ParserOutput transforms are used"
[lhc/web/wiklou.git] / includes / api / ApiParse.php
index ec015da..2839ab9 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Created on Dec 01, 2007
- *
  * Copyright © 2007 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
  *
  * This program is free software; you can redistribute it and/or modify
@@ -346,6 +344,7 @@ class ApiParse extends ApiBase {
                        $result_array['text'] = $p_result->getText( [
                                'allowTOC' => !$params['disabletoc'],
                                'enableSectionEditLinks' => !$params['disableeditsection'],
+                               'unwrap' => $params['wrapoutputclass'] === '',
                        ] );
                        $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'text';
                }
@@ -540,9 +539,9 @@ class ApiParse extends ApiBase {
                if ( $params['disabletidy'] ) {
                        $popts->setTidy( false );
                }
-               $popts->setWrapOutputClass(
-                       $params['wrapoutputclass'] === '' ? false : $params['wrapoutputclass']
-               );
+               if ( $params['wrapoutputclass'] !== '' ) {
+                       $popts->setWrapOutputClass( $params['wrapoutputclass'] );
+               }
 
                $reset = null;
                $suppressCache = false;