- $from = is_null( $params['from'] ) ? null : $this->keyToTitle( $params['from'] );
- $to = is_null( $params['to'] ) ? null : $this->keyToTitle( $params['to'] );
+ $from = is_null( $params['from'] ) ? null : $this->getCanonicalUserName( $params['from'] );
+ $to = is_null( $params['to'] ) ? null : $this->getCanonicalUserName( $params['to'] );
+
+ # MySQL doesn't seem to use 'equality propagation' here, so like the
+ # ActiveUsers special page, we have to use rc_user_text for some cases.
+ $userFieldToSort = $params['activeusers'] ? 'rc_user_text' : 'user_name';