Remove use of deprecated User::EDIT_TOKEN_SUFFIX
authoraddshore <addshorewiki@gmail.com>
Sun, 3 Apr 2016 09:04:42 +0000 (12:04 +0300)
committeraddshore <addshorewiki@gmail.com>
Sun, 3 Apr 2016 09:58:05 +0000 (12:58 +0300)
Change-Id: Ib36f4aac202019548131f956bffe1c73e46030d2

includes/user/User.php

index a272b37..bd1a642 100644 (file)
  */
 
 use MediaWiki\Session\SessionManager;
+use MediaWiki\Session\Token;
 
 /**
  * String Some punctuation to prevent editing from broken text-mangling proxies.
  * @deprecated since 1.27, use \\MediaWiki\\Session\\Token::SUFFIX
  * @ingroup Constants
  */
-define( 'EDIT_TOKEN_SUFFIX', MediaWiki\Session\Token::SUFFIX );
+define( 'EDIT_TOKEN_SUFFIX', Token::SUFFIX );
 
 /**
  * The User object encapsulates all of the user-specific settings (user_id,
@@ -4265,7 +4266,7 @@ class User implements IDBAccessObject {
         * @return bool Whether the token matches
         */
        public function matchEditTokenNoSuffix( $val, $salt = '', $request = null, $maxage = null ) {
-               $val = substr( $val, 0, strspn( $val, '0123456789abcdef' ) ) . self::EDIT_TOKEN_SUFFIX;
+               $val = substr( $val, 0, strspn( $val, '0123456789abcdef' ) ) . Token::SUFFIX;
                return $this->matchEditToken( $val, $salt, $request, $maxage );
        }