Use HTML::hidden to create input fields
authorWMDE-Fisch <christoph.jauera@wikimedia.de>
Tue, 25 Jul 2017 09:46:25 +0000 (11:46 +0200)
committerWMDE-Fisch <christoph.jauera@wikimedia.de>
Tue, 25 Jul 2017 09:46:25 +0000 (11:46 +0200)
Also add line break to comment added some patch before.

Change-Id: I9bd66b8444c069b4055fc5c3396256b688b78561

includes/EditPage.php

index 229a36a..e5fb4c5 100644 (file)
@@ -3220,16 +3220,13 @@ class EditPage {
 
        protected function showFormBeforeText() {
                global $wgOut;
-               $section = htmlspecialchars( $this->section );
-               $wgOut->addHTML( <<<HTML
-<input type='hidden' value="{$section}" name="wpSection"/>
-<input type='hidden' value="{$this->starttime}" name="wpStarttime" />
-<input type='hidden' value="{$this->edittime}" name="wpEdittime" />
-<input type='hidden' value="{$this->editRevId}" name="editRevId" />
-<input type='hidden' value="{$this->scrolltop}" name="wpScrolltop" id="wpScrolltop" />
-
-HTML
-               );
+
+               $wgOut->addHTML( Html::hidden( 'wpSection', htmlspecialchars( $this->section ) ) );
+               $wgOut->addHTML( Html::hidden( 'wpStarttime', $this->starttime ) );
+               $wgOut->addHTML( Html::hidden( 'wpEdittime', $this->edittime ) );
+               $wgOut->addHTML( Html::hidden( 'editRevId', $this->editRevId ) );
+               $wgOut->addHTML( Html::hidden( 'wpScrolltop', $this->scrolltop ) );
+
                if ( !$this->checkUnicodeCompliantBrowser() ) {
                        $wgOut->addHTML( Html::hidden( 'safemode', '1' ) );
                }
@@ -3493,8 +3490,8 @@ HTML
        }
 
        /**
-        * Inserts optional text shown below edit and upload forms. Can be used to offer special characters not present on
-        * most keyboards for copying/pasting.
+        * Inserts optional text shown below edit and upload forms. Can be used to offer special
+        * characters not present on most keyboards for copying/pasting.
         */
        protected function showEditTools() {
                global $wgOut;