Set saner default for parameters of LogEventsList::showOptions()
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Tue, 3 Dec 2013 21:52:43 +0000 (22:52 +0100)
committerSiebrand <siebrand@wikimedia.org>
Tue, 3 Dec 2013 21:54:09 +0000 (21:54 +0000)
Also cast input for Xml::dateMenu().

Change-Id: I28f9184626b01cce4a8080ba3337af0b3f941484

includes/logging/LogEventsList.php

index fabe153..8aa6511 100644 (file)
@@ -97,8 +97,9 @@ class LogEventsList extends ContextSource {
         * @param $filter: array
         * @param $tagFilter: array?
         */
-       public function showOptions( $types = array(), $user = '', $page = '', $pattern = '', $year = '',
-               $month = '', $filter = null, $tagFilter = '' ) {
+       public function showOptions( $types = array(), $user = '', $page = '', $pattern = '', $year = 0,
+               $month = 0, $filter = null, $tagFilter = ''
+       ) {
                global $wgScript, $wgMiserMode;
 
                $title = SpecialPage::getTitleFor( 'Log' );
@@ -122,7 +123,7 @@ class LogEventsList extends ContextSource {
                }
 
                // date menu
-               $html .= Xml::tags( 'p', null, Xml::dateMenu( $year, $month ) );
+               $html .= Xml::tags( 'p', null, Xml::dateMenu( (int)$year, (int)$month ) );
 
                // Tag filter
                if ( $tagSelector ) {