);
}
if ( isset( $this->prop['preferencestoken'] ) &&
- is_null( $this->getMain()->getRequest()->getVal( 'callback' ) ) &&
+ !$this->lacksSameOriginSecurity() &&
$user->isAllowed( 'editmyoptions' )
) {
$vals['preferencestoken'] = $user->getEditToken( '', $this->getMain()->getRequest() );
if ( isset( $this->prop['unreadcount'] ) ) {
$dbr = $this->getQuery()->getNamedDB( 'watchlist', DB_SLAVE, 'watchlist' );
- $sql = $dbr->selectSQLText(
+ $count = $dbr->selectRowCount(
'watchlist',
- array( 'dummy' => 1 ),
+ '1',
array(
'wl_user' => $user->getId(),
'wl_notificationtimestamp IS NOT NULL',
__METHOD__,
array( 'LIMIT' => self::WL_UNREAD_LIMIT )
);
- $count = $dbr->selectField( array( 'c' => "($sql)" ), 'COUNT(*)' );
if ( $count >= self::WL_UNREAD_LIMIT ) {
$vals['unreadcount'] = self::WL_UNREAD_LIMIT . '+';
} else {
- $vals['unreadcount'] = (int)$count;
+ $vals['unreadcount'] = $count;
}
}