Tomg, please test with error_reporting set to E_ALL or we will beat you up!
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 26 Oct 2005 20:37:10 +0000 (20:37 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 26 Oct 2005 20:37:10 +0000 (20:37 +0000)
* Set default value for $this->scrolltop
* Use proper function to get an integer or empty value, instead of bizarre
HTML-escape-random-junk-on-input

includes/EditPage.php

index f873041..87aa4d7 100644 (file)
@@ -29,7 +29,7 @@ class EditPage {
        var $minoredit = false, $watchthis = false, $recreate = false;
        var $textbox1 = '', $textbox2 = '', $summary = '';
        var $edittime = '', $section = '', $starttime = '';
-       var $oldid = 0, $editintro = '';
+       var $oldid = 0, $editintro = '', $scrolltop = null;
 
        /**
         * @todo document
@@ -319,7 +319,7 @@ class EditPage {
                        $this->edittime = $request->getVal( 'wpEdittime' );
                        $this->starttime = $request->getVal( 'wpStarttime' );
 
-                       $this->scrolltop = htmlentities( $request->getVal( 'wpScrolltop' ) );
+                       $this->scrolltop = $request->getIntOrNull( 'wpScrolltop' );
 
                        if( is_null( $this->edittime ) ) {
                                # If the form is incomplete, force to preview.