Index: trunk/phase3/includes/api/ApiQueryAllCategories.php |
— | — | @@ -59,12 +59,10 @@ |
60 | 60 | $this->addTables( 'category' ); |
61 | 61 | $this->addFields( 'cat_title' ); |
62 | 62 | |
63 | | - $fromdir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
64 | | - $todir = ( $params['dir'] != 'descending' ? 'older' : 'newer' ); |
| 63 | + $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
65 | 64 | $from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) ); |
66 | 65 | $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) ); |
67 | | - $this->addWhereRange( 'cat_title', $fromdir, $from, null ); |
68 | | - $this->addWhereRange( 'cat_title', $todir, $to, null ); |
| 66 | + $this->addWhereRange( 'cat_title', $dir, $from, $to ); |
69 | 67 | |
70 | 68 | if ( isset( $params['prefix'] ) ) { |
71 | 69 | $this->addWhere( 'cat_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); |
Index: trunk/phase3/includes/api/ApiQueryAllpages.php |
— | — | @@ -70,12 +70,11 @@ |
71 | 71 | } |
72 | 72 | |
73 | 73 | $this->addWhereFld( 'page_namespace', $params['namespace'] ); |
74 | | - $fromdir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
75 | | - $todir = ( $params['dir'] != 'descending' ? 'older' : 'newer' ); |
| 74 | + $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
76 | 75 | $from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) ); |
77 | 76 | $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) ); |
78 | | - $this->addWhereRange( 'page_title', $fromdir, $from, null ); |
79 | | - $this->addWhereRange( 'page_title', $todir, $to, null ); |
| 77 | + $this->addWhereRange( 'page_title', $dir, $from, $to ); |
| 78 | + |
80 | 79 | |
81 | 80 | if ( isset( $params['prefix'] ) ) { |
82 | 81 | $this->addWhere( 'page_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); |
Index: trunk/phase3/includes/api/ApiQueryAllimages.php |
— | — | @@ -78,12 +78,10 @@ |
79 | 79 | $params = $this->extractRequestParams(); |
80 | 80 | |
81 | 81 | // Image filters |
82 | | - $fromdir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
83 | | - $todir = ( $params['dir'] != 'descending' ? 'older' : 'newer' ); |
| 82 | + $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
84 | 83 | $from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) ); |
85 | 84 | $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) ); |
86 | | - $this->addWhereRange( 'img_name', $fromdir, $from, null ); |
87 | | - $this->addWhereRange( 'img_name', $todir, $to, null ); |
| 85 | + $this->addWhereRange( 'img_name', $dir, $from, $to ); |
88 | 86 | |
89 | 87 | if ( isset( $params['prefix'] ) ) |
90 | 88 | $this->addWhere( 'img_name' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); |