Validates that the destination is unique
@return boolean
508825
protected function validateDestinationCreate()
    {
        if ($this->isError()) {
            return null;
        }

        $name = $this->getSubmitted('name');
        $files = $this->getSubmitted('files');

        /* @var $file \SplFileInfo */
        $file = reset($files);
        $directory = $file->getRealPath();

        if (file_exists("$directory/$name")) {
            $this->setError('name', $this->translation->text('Destination already exists'));
            return false;
        }

        $this->setSubmitted('destination', "$directory/$name");
        return true;
    }
361682
private function specificRouteRestrictionExists()
    {
        $requestMethod = isset($_POST['_method']) ? $_POST['_method'] : $_SERVER['REQUEST_METHOD'];
        
        $routes = app('router')->getRoutes()->match(app('request')->create($_SERVER['REQUEST_URI'], $requestMethod));


        if (!$routes) {
            throw new Exception('Error determining current route.');
        }

        if (get_class($routes) != \Illuminate\Routing\Route::class && count($routes) != 1) {
            $routes = $routes->first();
        }
        
        foreach($routes->middleware() as $routeMiddleware) {
            $routeMiddlewareParts = explode(':', $routeMiddleware);
            if ($routeMiddlewareParts[0]=='routeRestrictor') {
                return true;
            }
        }

        return false;
    }
937440
public function validation()
    {

        $validator = new Validation();

        $validator->add('name', new PresenceOf([
            'message' => 'User type name must be supplied'
        ]));

        $validator->add('name', new Uniqueness([
            'message' => 'Sorry, the user type already exists'
        ]));

        return $this->validate($validator);
    }
295006
public function isTransactionVerificationValid()
    {
        $this->verifyTransactionAtGateway();

        $result = $this->getResponse()['message'];

        switch ($result) {
            case self::VS:
                $validate = true;
                break;
            case self::ITF:
                $validate = false;
                break;
            default:
                $validate = false;
                break;
        }

        return $validate;
    }
94084
public function isValid()
    {
        $statusList = \Genesis\Utils\Common::getClassConstants(__CLASS__);

        return in_array(strtolower($this->status), $statusList);
    }
235252
public function valid() {

		if ( empty( $this->pod_id ) ) {
			return false;
		}

		if ( $this->iterator ) {
			return isset( $this->rows[ $this->row_number ] );
		}

		return true;
	}
344282
public function is_valid()
    {
        $isauthority = $this->iuserinfo !== null || $this->ihost !== null || $this->port !== null;
        if ($this->ipath !== '' &&
            (
                $isauthority && (
                    $this->ipath[0] !== '/' ||
                    substr($this->ipath, 0, 2) === '//'
                ) ||
                (
                    $this->scheme === null &&
                    !$isauthority &&
                    strpos($this->ipath, ':') !== false &&
                    (strpos($this->ipath, '/') === false ? true : strpos($this->ipath, ':') < strpos($this->ipath, '/'))
                )
            )
        )
        {
            return false;
        }

        return true;
    }
53917
public function isValid()
	{
	  	// Skip without submission
		if (strtoupper($_SERVER['REQUEST_METHOD']) !== 'POST') {

			return FALSE;

		} else {

			$captchaChallenge = isset($_POST['recaptcha_challenge_field'])
				? $this->_sanitizeField($_POST['recaptcha_challenge_field'])
				: NULL;

			$captchaResponse  = isset($_POST['recaptcha_response_field'])
				? $this->_sanitizeField($_POST['recaptcha_response_field'])
				: NULL;
		 	// Skip empty submission
			if ( strlen($captchaChallenge) == 0 || strlen($captchaResponse) == 0 ) {
				$this->setError('incorrect-captcha-sol');
				return FALSE;
			}

			$data = array(
				'privatekey' => $this->_privateKey,
				'remoteip'   => $this->_remoteIp(),
				'challenge'  => $captchaChallenge,
				'response'   => $captchaResponse
				);

			$result = $this->_postHttpChallenge($data);

			if ( $result['isvalid'] === "true") {
				return TRUE;

			} else {
				$this->setError($result['error']);
			}
			return FALSE;
		}
	}
1098226
public function isValid()
    {
        $valid = $this->prefix != '';
        $valid = $valid && $this->startMultiLine != '';
        $valid = $valid && $this->endMultiLine != '';
        $valid = $valid && $this->simpleDirective != '';

        return $valid;
    }
1239984
public function validateReceived()
    {
        $this->debugMessage[] = 'IPN VALIDATION: START';
        if (!$this->ipnPostDataCheck()) {
            $this->debugMessage[] = 'IPN VALIDATION: END';
            return false;
        }

        //'ORDERSTATUS'
        $this->logFunc("IPN", $this->postData, @$this->postData['REFNOEXT']);
        if (!in_array(trim($this->postData['ORDERSTATUS']), $this->successfulStatus)) {
            $this->errorMessage[] = 'INVALID IPN ORDER STATUS: ' . $this->postData['ORDERSTATUS'];
            $this->debugMessage[] = 'IPN VALIDATION: END';
            return false;
        }
        $validationResult = false;
        $calculatedHashString = $this->createHashString($this->flatArray($this->postData, array("HASH")));
        if ($calculatedHashString == $this->postData['HASH']) {
            $validationResult = true;
        }
        if ($validationResult) {
            $this->debugMessage[] = 'IPN VALIDATION: ' . 'SUCCESSFUL';
            $this->debugMessage[] = 'IPN CALCULATED HASH: ' . $calculatedHashString;
            $this->debugMessage[] = 'IPN HASH: ' . $this->postData['HASH'];
            $this->debugMessage[] = 'IPN VALIDATION: END';
            return true;
        } elseif (!$validationResult) {
            $this->errorMessage[] = 'IPN VALIDATION: ' . 'FAILED';
            $this->errorMessage[] = 'IPN CALCULATED HASH: ' . $calculatedHashString;
            $this->errorMessage[] = 'IPN RECEIVED HASH: ' . $this->postData['HASH'];
            $this->debugMessage[] = 'IPN VALIDATION: END';
            return false;
        }
        return false;
    }
481358
protected function validateOrderCheckout()
    {
        if ($this->same_payment_address) {
            $this->unsetSubmitted('address.payment');
        }

        $this->setSubmitted('update', array());
        $this->setSubmitted('store_id', $this->store_id);
        $this->setSubmitted('user_id', $this->order_user_id);
        $this->setSubmitted('creator', $this->admin_user_id);

        if ($this->admin) {
            $this->setSubmitted('status', $this->order->getStatusInitial());
        }

        return $this->validateComponent('order');
    }
723125
public function isValid()
    {
        $hashedBody = strtoupper(hash_hmac('sha512', $this->webhookJson, $this->signature));
        return (isset($this->headers['X-ANET-SIGNATURE']) && strtoupper(explode('=', $this->headers['X-ANET-SIGNATURE'])[1]) === $hashedBody);
    }
243584
public function getUniqueKey()
    {
        if (!isset($this->options['unique_key'])) {
            $this->options['unique_key'] = null;
        }
        if ($this->options['unique_key'] && is_string($this->options['unique_key'])) {
            $this->options['unique_key'] = StringHelper::toArray($this->options['unique_key'], ',');
        }
        
        return $this->options['unique_key'];
    }
707612
protected function validate()
    {
        // Are needed session variables set ?
        if (!isset($_SESSION['s3ss10nCr3at3d']) || !isset($_SESSION['n3k0t'])) {
            return false;
        }

        // Check if session token match ?
        if ($this->matchUserAgent) {
            if ($_SESSION['n3k0t'] !== hash_hmac($this->hashAlgo, $_SERVER['HTTP_USER_AGENT'] . $_SESSION['s3ss10nCr3at3d'], $this->hashKey)) {
                return false;
            }
        } elseif ($_SESSION['n3k0t'] !== hash_hmac($this->hashAlgo, $_SESSION['s3ss10nCr3at3d'], $this->hashKey)) {
            return false;
        }

        // Is session expired ?
        if ((time() > ($_SESSION['s3ss10nCr3at3d']) + $this->expiration)) {
            return false;
        }

        // Everything is fine return true
        return true;
    }
59619
public function isValid()
    {
        if (!$this->oxorderfiles__oxmaxdownloadcount->value || ($this->oxorderfiles__oxdownloadcount->value < $this->oxorderfiles__oxmaxdownloadcount->value)) {
            if (!$this->oxorderfiles__oxlinkexpirationtime->value && !$this->oxorderfiles__oxdownloadxpirationtime->value) {
                return true;
            } else {
                $sNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
                $iTimestamp = strtotime($this->oxorderfiles__oxvaliduntil->value);
                if (!$iTimestamp || ($iTimestamp > $sNow)) {
                    return true;
                }
            }
        }

        return false;
    }
735402
protected function validateDestinationNameCopy()
    {
        $destination = $this->getSubmitted('destination');

        if ($destination !== '' && preg_match('/^[\w-]+[\w-\/]*[\w-]+$|^[\w-]$/', $destination) !== 1) {
            $this->setErrorInvalid('destination', $this->translation->text('Destination'));
        }
    }
804267
def validate_unique(self):
        
        unique_checks, date_checks = self.instance._get_unique_checks(exclude=[])
        errors = self.instance._perform_unique_checks(unique_checks)
        if errors:
            self.add_error(None, errors)