+ $mtime1 = $dbr->timestampOrNull( $this->getOption( 'mtimeafter', null ) );
+ $mtime2 = $dbr->timestampOrNull( $this->getOption( 'mtimebefore', null ) );
+
+ $tables = array( 'image' );
+ $logJoinOn = array( 'log_namespace' => NS_FILE, 'log_title = img_name' );
+ $logJoinOn['log_type'] = array( 'upload', 'move', 'delete' );
+ if ( $mtime1 ) {
+ $logJoinOn[] = "log_timestamp > {$dbr->addQuotes($mtime1)}";
+ }
+ if ( $mtime2 ) {
+ $logJoinOn[] = "log_timestamp < {$dbr->addQuotes($mtime2)}";
+ }
+ if ( $mtime1 || $mtime2 ) {
+ $tables[] = 'logging';
+ }
+