Harish halo has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/320076

Change subject: Fix token match warning for token ending improperly
......................................................................

Fix token match warning for token ending improperly

To give warning if token ends for example with "\",Fixed by matching the
end of $token string with urldecode(User::EDIT_TOKEN_SUFFIX).

Bug: T122280
Change-Id: Icdafcd7c65e018d96075a138979659a475e40906
---
M includes/api/ApiCheckToken.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/76/320076/1

diff --git a/includes/api/ApiCheckToken.php b/includes/api/ApiCheckToken.php
index ce1adca..69b43b7 100644
--- a/includes/api/ApiCheckToken.php
+++ b/includes/api/ApiCheckToken.php
@@ -39,7 +39,7 @@
                $tokenObj = ApiQueryTokens::getToken(
                        $this->getUser(), $this->getRequest()->getSession(), 
$salts[$params['type']]
                );
-               if ( $tokenObj->match( $token[strlen($token)-1], urldecode( 
User::EDIT_TOKEN_SUFFIX ) ) ){
+               if ( $tokenObj->match( $token[strlen($token)-1], urldecode( 
User::EDIT_TOKEN_SUFFIX ) ) ) {
                        $res['result'] = 'Warning';
                 }
                elseif ( $tokenObj->match( $token, $maxage ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/320076
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icdafcd7c65e018d96075a138979659a475e40906
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Harish halo <harishrs...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to