*/
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
+ * @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,
/**
* Global constant made accessible as class constants so that autoloader
* magic can be used.
- * @deprecated since 1.27, use \\MediaWiki\\Session\\Token::SUFFIX
+ * @deprecated since 1.27, use \MediaWiki\Session\Token::SUFFIX
*/
const EDIT_TOKEN_SUFFIX = EDIT_TOKEN_SUFFIX;
*/
public function addWatch( $title, $checkRights = self::CHECK_USER_RIGHTS ) {
if ( !$checkRights || $this->isAllowed( 'editmywatchlist' ) ) {
- WatchedItemStore::getDefaultInstance()->addWatchBatch( [
- [ $this, $title->getSubjectPage() ],
- [ $this, $title->getTalkPage() ],
- ]
+ WatchedItemStore::getDefaultInstance()->addWatchBatchForUser(
+ $this,
+ [ $title->getSubjectPage(), $title->getTalkPage() ]
);
}
$this->invalidateCache();
* @since 1.27
* @param string|array $salt Array of Strings Optional function-specific data for hashing
* @param WebRequest|null $request WebRequest object to use or null to use $wgRequest
- * @return MediaWiki\\Session\\Token The new edit token
+ * @return MediaWiki\Session\Token The new edit token
*/
public function getEditTokenObject( $salt = '', $request = null ) {
if ( $this->isAnon() ) {
/**
* Get the embedded timestamp from a token.
- * @deprecated since 1.27, use \\MediaWiki\\Session\\Token::getTimestamp instead.
+ * @deprecated since 1.27, use \MediaWiki\Session\Token::getTimestamp instead.
* @param string $val Input token
* @return int|null
*/
* @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 );
}