Attempts to confirm the validation of the Wordpress nonce.
@param  string $mixedNonceSalt
@return boolean
@link https://codex.wordpress.org/Function_Reference/wp_verify_nonce
320400
public function nonceValidates($mixedNonceSalt)
    {
        $token = null;

        if ($this->hasPost("authenticity_token")) {
            $token = $this->post("authenticity_token");
        } elseif ($this->hasGet("authenticity_token")) {
            $token = $this->get("authenticity_token");
        }

        if (is_null($token)) {
            return false;
        }

        $key = $this->generateNonceKey($mixedNonceSalt);

        return wp_verify_nonce($token, $key);
    }
568527
public function confirm($newEmail)
    {
        // update status
        $this->status = static::STATUS_ACTIVE;

        // process $newEmail from a userToken
        //   check if another user already has that email
        $success = true;
        if ($newEmail) {
            $checkUser = static::findOne(["email" => $newEmail]);
            if ($checkUser) {
                $success = false;
            } else {
                $this->email = $newEmail;
            }
        }

        $this->save(false, ["email", "status"]);
        return $success;
    }
750983
public static function verifyNonce($nonce, $action)
    {
        //Safety check for multiple nonces
        if (is_array($nonce)) {
            $nonce = array_shift($nonce);
        }

        //Nonce generated 0-12 hours ago
        if ($nonce === self::getNonce($action)) {
            return true;
        }

        //Nonce generated 12-24 hours ago
        $previousTick = true;

        return $nonce === self::getNonce($action, $previousTick);
    }
1159879
public function setNonce($nonce = null)
    {
        $this->nonce = $nonce;
        if ($nonce === null) {
            $this->nonce = new Nonce();
        }
        return $this;
    }
483919
public function isValidItem($mixValue){
		if($this->hasOption('max')){
			if(count($this->mixValue)>=$this->options()->max){
				throw new MaxException($this->options()->max);
				return false;
			}
		}

		return true;
	}
77654
public function getNoncer()
    {
        if (!isset($this->noncer)) {
            $this->noncer = new self::$defaultNoncerClass($this->noncerLength);
            if (!$this->noncer instanceof NoncerInterface) {
                throw new \UnexpectedValueException('Noncer must implement Acquia\Rest\NoncerInterface');
            }
        }
        return $this->noncer;
    }
756932
protected function removeNonce($nonce)
    {
        if (null === $this->registryRepository) {
            @unlink($this->nonceDir.DIRECTORY_SEPARATOR.$nonce);
        } else {
            $registry = $this->getRegistry($nonce);
            $this->registryRepository->remove($registry);
        }
    }
840085
function checkNonceMatch(context) {
    var newNonce1 = Buffer.concat([utility.string2Buffer(context.newNonce, 32), new Buffer([1]), context.authKeyAuxHash]);
    var newNonceHash = utility.buffer2String(utility.createSHAHash(newNonce1).slice(-16));
    var serverNewNonceHash = context.setClientDHParamsAnswer.new_nonce_hash1;
    if (logger.isDebugEnabled()) {
        logger.debug('newNonceHash = %s, new_nonce_hash1 = %s', newNonceHash.toString(), serverNewNonceHash.toString());
    }
    if (newNonceHash !== serverNewNonceHash) {
        logger.warn('\'dh_gen_ok.new_nonce_hash1\' check fails!');
        throw createError(newNonceHash + ' != ' + serverNewNonceHash, 'EREPLAYATTACK');
    }
    return context;
}
1010470
public function isValid($mixed, ArrayAccess $error = null)
    {
        if ($mixed !== null && !is_string($mixed)) {
            throw new InvalidArgumentException(t('Invalid type supplied to validator.'));
        }

        if ($this->getMinimumLength() > strlen($mixed)) {
            if ($error && $message = $this->getErrorString(self::E_TOO_SHORT, $mixed)) {
                $error[] = $message;
            }

            return false;
        }

        return true;
    }
982154
public function validate($type, $data, $mayBeNull = false, $mayBeEmpty = false, $exceptions = true)
    {
       return $this->validation($type, $data, $mayBeNull, $mayBeEmpty, $exceptions);
    }
25339
def validate_nonce(nonce, secret):
    '''
    
    '''
    nonce_components = nonce.split(':', 2)
    if not len(nonce_components) == 3:
        return False
    timestamp = nonce_components[0]
    salt = nonce_components[1]
    nonce_signature = nonce_components[2]

    calculated_nonce = calculate_nonce(timestamp, secret, salt)

    if not nonce == calculated_nonce:
        return False

    return True
1309567
protected function validateInheritdoc(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $commentStart, $commentEnd)
    {
        $classHelper = new ClassHelper($phpcsFile);

        $commentString = $phpcsFile->getTokensAsString($commentStart, $commentEnd - $commentStart + 1);
        if (preg_match('/\{\@inheritdoc\}/', $commentString)) {
            $classes = $classHelper->getClassParentsAndInterfaces($stackPtr, 'validate {@inheritdoc}');
            if (false !== $classes) {
                $method = $phpcsFile->getDeclarationName($stackPtr);
                foreach ($classes as $class) {
                    if (method_exists($class, $method)) {
                        return true;
                    }
                }
                $error = 'No overrided method found for {@inheritdoc} annotation';
                $phpcsFile->addError($error, $commentStart, 'InvalidInheritdoc');
            } else {
                return true;
            }
        }
        return false;
    }
1148093
public function loadConsumerNonce($nonce)
    {

        $ok = true;

// Delete any expired nonce values
        $now = date("{$this->dateFormat} {$this->timeFormat}", time());
        $sql = "DELETE FROM {$this->dbTableNamePrefix}" . DataConnector::NONCE_TABLE_NAME . " WHERE expires <= '{$now}'";
        mysql_query($sql);

// Load the nonce
        $sql = sprintf("SELECT value AS T FROM {$this->dbTableNamePrefix}" . DataConnector::NONCE_TABLE_NAME . ' WHERE (consumer_pk = %d) AND (value = %s)',
                       $nonce->getConsumer()->getRecordId(), DataConnector::quoted($nonce->getValue()));
        $rs_nonce = mysql_query($sql);
        if ($rs_nonce) {
            $row = mysql_fetch_object($rs_nonce);
            if ($row === false) {
                $ok = false;
            }
        }

        return $ok;

    }
699179
private function check_nonce($consumer, $token, $nonce, $timestamp)
    {
        if( ! $nonce )
            throw new Exception(
                'Missing nonce parameter. The parameter is required'
            );

        // verify that the nonce is uniqueish
        $found = $this->data_store->lookup_nonce(
            $consumer,
            $token,
            $nonce,
            $timestamp
        );
        if ($found) {
            throw new Exception("Nonce already used: $nonce");
        }
    }
1191317
public static function setCasServerCACert($cert, $validate_cn = true)
    {
        phpCAS :: traceBegin();
        phpCAS::_validateClientExists();

        try {
            self::$_PHPCAS_CLIENT->setCasServerCACert($cert, $validate_cn);
        } catch (Exception $e) {
            phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
        }

        phpCAS :: traceEnd();
    }
1032368
public function isValidFor($mixed, $subject = null, ArrayAccess $error = null)
    {
        $result = parent::isValid($mixed, $error);
        if ($result === true) {
            $uID = 0;
            if ($subject) {
                if (is_object($subject)) {
                    if (!method_exists($subject, 'getUserID')) {
                        throw new InvalidArgumentException(t('Invalid subject type supplied to validator.'));
                    }
                    $uID = (int) $subject->getUserID();
                } else {
                    $uID = (int) $subject;
                }
            } else {
                $uID = 0;
            }
            $qb = $this->connection->createQueryBuilder();
            $qb
                ->select('u.uID')
                ->from('Users', 'u')
                ->where($qb->expr()->eq('u.uEmail', $qb->createNamedParameter($mixed)))
            ;
            if ($uID !== 0) {
                $qb->andWhere($qb->expr()->neq('u.uID', $qb->createNamedParameter($uID)));
            }
            if ($qb->execute()->fetchColumn() !== false) {
                $result = false;
                if ($error) {
                    $message = $this->getErrorString($uID === 0 ? self::E_EMAIL_IN_USE : self::E_EMAIL_USED_BY_ANOTHER_USER, $mixed);
                    if ($message) {
                        $error[] = $message;
                    }
                }
            }
        }

        return $result;
    }
296191
public function isValid($mixValue){
		if(is_null($mixValue)){
			return true;
		}

		if(is_object($mixValue)){
			if($this->hasOption('class')){
				$strClass = $this->options()->class;

				if($mixValue instanceof $strClass){
					return true;
				}else{
					throw new ClassException($mixValue, $strClass);
					return false;
				}
			}
			return true;
		}
		return false;
	}