Merge "Trim surrounding whitespace and seperators from tokens"

This commit is contained in:
jenkins-bot 2016-11-21 21:59:07 +00:00 committed by Gerrit Code Review
commit 1fc19d6cc4

View file

@ -98,6 +98,11 @@ class OATHAuthKey {
Base32::decode( $this->secret['secret'] ),
$this->secret['period'], -$wgOATHAuthWindowRadius, $wgOATHAuthWindowRadius
);
// Remove any whitespace from the received token, which can be an intended group seperator
// or trimmeable whitespace
$token = preg_replace( '/\s+/', '', $token );
// Check to see if the user's given token is in the list of tokens generated
// for the time window.
foreach ( $results as $window => $result ) {