Merge "Use wikimedia/utfnormal library, add backwards-compatability layer"
[lhc/web/wiklou.git] / includes / api / ApiQueryUserInfo.php
index aa38564..1e3a432 100644 (file)
@@ -115,7 +115,7 @@ class ApiQueryUserInfo extends ApiQueryBase {
                        );
                }
                if ( isset( $this->prop['preferencestoken'] ) &&
-                       is_null( $this->getMain()->getRequest()->getVal( 'callback' ) ) &&
+                       !$this->lacksSameOriginSecurity() &&
                        $user->isAllowed( 'editmyoptions' )
                ) {
                        $vals['preferencestoken'] = $user->getEditToken( '', $this->getMain()->getRequest() );
@@ -181,7 +181,7 @@ class ApiQueryUserInfo extends ApiQueryBase {
                        if ( $count >= self::WL_UNREAD_LIMIT ) {
                                $vals['unreadcount'] = self::WL_UNREAD_LIMIT . '+';
                        } else {
-                               $vals['unreadcount'] = (int)$count;
+                               $vals['unreadcount'] = $count;
                        }
                }