Code Duplication    Length = 7-7 lines in 3 locations

includes/api/ApiQueryAllCategories.php 1 location

@@ 61-67 (lines=7) @@
58
		$this->addTables( 'category' );
59
		$this->addFields( 'cat_title' );
60
61
		if ( !is_null( $params['continue'] ) ) {
62
			$cont = explode( '|', $params['continue'] );
63
			$this->dieContinueUsageIf( count( $cont ) != 1 );
64
			$op = $params['dir'] == 'descending' ? '<' : '>';
65
			$cont_from = $db->addQuotes( $cont[0] );
66
			$this->addWhere( "cat_title $op= $cont_from" );
67
		}
68
69
		$dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' );
70
		$from = ( $params['from'] === null

includes/api/ApiQueryAllImages.php 1 location

@@ 126-132 (lines=7) @@
123
			}
124
125
			// Pagination
126
			if ( !is_null( $params['continue'] ) ) {
127
				$cont = explode( '|', $params['continue'] );
128
				$this->dieContinueUsageIf( count( $cont ) != 1 );
129
				$op = ( $ascendingOrder ? '>' : '<' );
130
				$continueFrom = $db->addQuotes( $cont[0] );
131
				$this->addWhere( "img_name $op= $continueFrom" );
132
			}
133
134
			// Image filters
135
			$from = ( $params['from'] === null ? null : $this->titlePartToKey( $params['from'], NS_FILE ) );

includes/api/ApiQueryAllPages.php 1 location

@@ 74-80 (lines=7) @@
71
		// Page filters
72
		$this->addTables( 'page' );
73
74
		if ( !is_null( $params['continue'] ) ) {
75
			$cont = explode( '|', $params['continue'] );
76
			$this->dieContinueUsageIf( count( $cont ) != 1 );
77
			$op = $params['dir'] == 'descending' ? '<' : '>';
78
			$cont_from = $db->addQuotes( $cont[0] );
79
			$this->addWhere( "page_title $op= $cont_from" );
80
		}
81
82
		if ( $params['filterredir'] == 'redirects' ) {
83
			$this->addWhereFld( 'page_is_redirect', 1 );