<?php
-
/**
- * Created on Sep 25, 2006
- *
* API for MediaWiki 1.8+
*
+ * Created on Sep 25, 2006
+ *
* Copyright © 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
*
* This program is free software; you can redistribute it and/or modify
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
*/
if ( !defined( 'MEDIAWIKI' ) ) {
}
$this->addWhereFld( 'page_namespace', $params['namespace'] );
- $fromdir = ( $params['dir'] == 'descending' ? 'older' : 'newer' );
- $todir = ( $params['dir'] != 'descending' ? 'older' : 'newer' );
+ $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' );
$from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) );
$to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) );
- $this->addWhereRange( 'page_title', $fromdir, $from, null );
- $this->addWhereRange( 'page_title', $todir, $to, null );
-
+ $this->addWhereRange( 'page_title', $dir, $from, $to );
+
if ( isset( $params['prefix'] ) ) {
$this->addWhere( 'page_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
}