Check request
@access protected
349013
protected function checkRequest()
    {
        if (preg_match(CKFINDER_REGEX_INVALID_PATH, $this->_currentFolder->getClientPath())) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
        }

        $_resourceTypeConfig = $this->_currentFolder->getResourceTypeConfig();

        if (is_null($_resourceTypeConfig)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
        }

        $_clientPath = $this->_currentFolder->getClientPath();
        $_clientPathParts = explode("/", trim($_clientPath, "/"));
        if ($_clientPathParts) {
            foreach ($_clientPathParts as $_part) {
                if ($_resourceTypeConfig->checkIsHiddenFolder($_part)) {
                    $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
                }
            }
        }

        if (!is_dir($this->_currentFolder->getServerPath())) {
            if ($_clientPath == "/") {
                if (!CKFinder_Connector_Utils_FileSystem::createDirectoryRecursively($this->_currentFolder->getServerPath())) {
                    /**
                     * @todo handle error
                     */
                }
            }
            else {
                $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND);
            }
        }
    }
165501
private function check_if_allowed()
    {
        $check = \wp_check_filetype_and_ext($this->data['tmp_name'], $this->client_name);

        if ($check['type'] !== false) {
            $this->guessed_type = $check['type'];
            $this->guessed_extension = $check['ext'];
        }

        if (($check['type'] === false || $check['ext'] === false)
            && !\current_user_can('unfiltered_upload')
        ) {
            return false;
        }

        $allowed_types = \get_allowed_mime_types();

        return \in_array($this->client_type, $allowed_types);
    }
558964
protected function detectRequest()
    {
        $parseUrl = parse_url($this->serverValue('REQUEST_URI'));
        $scheme   = ($this->ssl === true) ? 'https' : 'http';

        $request = [
            'scheme'   => $scheme,
            'host'     => $this->serverValue('HTTP_HOST'),
            'port'     => $this->serverValue('SERVER_PORT'),
            'user'     => $this->serverValue('PHP_AUTH_USER'),
            'pass'     => $this->serverValue('PHP_AUTH_PW'),
            'path'     => '',
            'query'    => '',
            'fragment' => '',
        ];

        //Keep auto-convert to object. Less complexity for merge with array.
        $this->request = (object) array_merge($request, $parseUrl);
    }
300896
protected function checkValidity() {
		if($this->validTo && $this->validTo < time() && isSet($this->opts['username']) && isSet($this->opts['password']))
			$this->requestToken();
	}
1335699
public function checkRequestLimit()
  {
    $isLimitReached = false;
    $client     = $this->getClient();
    
    if ( ! is_null($client)) {
      $currentTotalRequest = 1;
      $currentTime     = time();
      $requestLimitUntil   = $currentTime;
      
      $requestLimitUntil = strtotime($client->request_limit_until);
      if ($requestLimitUntil < 0) {
        $requestLimitUntil = $currentTime;
      }

      if ($currentTime <= $requestLimitUntil) {
        $currentTotalRequest = $client->current_total_request + 1;

        if ($currentTotalRequest > $client->request_limit) {
          $isLimitReached = true;
        }
      }

      if ($currentTime > $requestLimitUntil) {
        $dateTime = new DateTime('+1 hour');

        $requestLimitUntil = $dateTime->getTimestamp();

        unset($dateTime);
      }

      if ( ! $isLimitReached) {
        $dateTime = new DateTime();

        $client->current_total_request = $currentTotalRequest;
        $client->request_limit_until   = $dateTime->setTimestamp($requestLimitUntil)->format('Y-m-d H:i:s');
        $client->last_request_at     = $dateTime->setTimestamp($currentTime)->format('Y-m-d H:i:s');

        $client->save();

        unset($dateTime);
      }
    }

    unset($client);

    return $isLimitReached;
  }
1093232
protected static function checkServerPort(Request $request): bool
    {
        return $request->server->has('SERVER_PORT') && self::HTTPS === (int)$request->server->get('SERVER_PORT');
    }
1047233
public function check(Request $request)
    {
        /** @var $response \Bolt\Storage\Database\Schema\SchemaCheck */
        $check = $this->app['schema']->check();

        $context = [
            'changes' => null,
            'check'   => $check,
            'debug'   => $request->query->has('debug'),
            'alters'  => $this->app['schema.comparator']->getAlters(),
            'creates' => $this->app['schema.comparator']->getCreates(),
            'diffs'   => $this->app['schema.comparator']->getDiffs(),
        ];

        return $this->render('@bolt/dbcheck/dbcheck.twig', $context);
    }
477290
function(req, res, next){
    that.accessCheck(req, res, next, {forceHeaderCheck: true});
  }
892327
public function check()
    {
        $pdoResult = extension_loaded('PDO');
        $pdoMySqlResult = extension_loaded('pdo_mysql');

        $result = ($pdoResult === true && $pdoMySqlResult === true);

        if ($pdoResult === true) {
            $this->pdoVersion = phpversion('PDO');
        }

        if ($pdoMySqlResult === true) {
            $this->pdoMySqlVersion = phpversion('pdo_mysql');
        }

        return $result;
    }
1128570
private function checkFormIdInPost($request)
    {
        if (!isset($request::$post[self::PARAMETER_FORM_ID])) {
            return false;
        }

        if (!$request::$post[self::PARAMETER_FORM_ID] === $this->formId) {
            return false;
        }

        return true;
    }
495257
private function checkFunctions()
    {
        if (!function_exists('apache_request_headers')) {
            function apache_request_headers()
            {
                $arh = array();
                $rx_http = '/\AHTTP_/';
                foreach ($_SERVER as $key => $val) {
                    if (preg_match($rx_http, $key)) {
                        $arh_key = preg_replace($rx_http, '', $key);
                        $rx_matches = explode('_', $arh_key);
                        if (count($rx_matches) > 0 and strlen($arh_key) > 2) {
                            foreach ($rx_matches as $ak_key => $ak_val) {
                                $rx_matches[$ak_key] = ucfirst($ak_val);
                            }
                            $arh_key = implode('-', $rx_matches);
                        }
                        $arh[$arh_key] = $val;
                    }
                }
                return ($arh);
            }
        }
    }
519539
protected function parse_request(){
		if (isset($_GET['action'])){
			$action = $_GET['action'];
			//simple request mode
			if ($action == "get"){
				//data request
				if (isset($_GET['id'])){
					//single entity data request
					$this->request->set_filter($this->config->id["name"],$_GET['id'],"=");
				} else {
					//loading collection of items
				}
			} else {
				//data saving
				$this->editing = true;
			}
			parent::check_csrf();
		} else {
			if (isset($_GET['editing']) && isset($_POST['ids']))
				$this->editing = true;			
			parent::parse_request();
		}
	
		if (isset($_GET["start"]) && isset($_GET["count"]))
			$this->request->set_limit($_GET["start"],$_GET["count"]);

	}
667306
protected function check()
    {
        try {
            $options = $this->getOptions();

            // retrieve player count
            $response = $this->mcStatus->query(true);

            if (!is_array($response)
                || !array_key_exists('player_count', $response)
            ) {
                $this->setMessage('No response from Minecraft server query.');
                $this->setCode(self::STATE_UNKNOWN);

                return $this;
            }

            $playerCount = $response['player_count'];

            if ($playerCount >= (int)$options['thresholdCritical']) {
                $this->setMessage(
                    sprintf(
                        'CRITICAL - %1$u players currently logged in|users=%1$u',
                        $response['player_count']
                    )
                );
                $this->setCode(self::STATE_CRITICAL);

                return $this;
            }

            if ($playerCount >= (int)$options['thresholdWarning']) {
                $this->setMessage(
                    sprintf(
                        'WARNING - %u players currently logged in|users=%1$u',
                        $response['player_count']
                    )
                );
                $this->setCode(self::STATE_WARNING);

                return $this;
            }

            $this->setMessage(
                sprintf(
                    'OK - %u players currently logged in|users=%1$u',
                    $playerCount
                )
            );
            $this->setCode(self::STATE_OK);

            return $this;

        } catch (\Exception $e) {
            $this->setMessage('Error from Mcstat: ' . $e->getMessage());
            $this->setCode(self::STATE_UNKNOWN);

            return $this;
        }
    }
1071976
protected function _checkInclude($include) {
        $request = Request::instance();

        if (isset($include['no'])) {
            if (in_array('.' . $request->src, $include['no']) || in_array('.' . $request->src . '.' . $request->controller, $include['no']) || in_array('.' . $request->src . '.' . $request->controller . '.' . $request->action, $include['no']) || in_array('.' . $request->controller, $include['no']) || in_array('.' . $request->controller . '.' . $request->action, $include['no'])) {
                return false;
            }
            else {
                return true;
            }
        }
        if (isset($include['yes'])) {
            if (in_array('.' . $request->src, $include['yes']) || in_array('.' . $request->src . '.' . $request->controller, $include['yes']) || in_array('.' . $request->src . '.' . $request->controller . '.' . $request->action, $include['yes']) || in_array('.' . $request->controller, $include['yes']) || in_array('.' . $request->controller . '.' . $request->action, $include['yes'])) {
                return true;
            }
            else {
                return false;
            }
        }

        return true;
    }
931234
public function request_security_check($mode = rcube_utils::INPUT_POST)
    {
        // check request token
        if (!$this->check_request($mode)) {
            $error = array('code' => 403, 'message' => "Request security check failed");
            self::raise_error($error, false, true);
        }

        // check referer if configured
        if ($this->config->get('referer_check') && !rcube_utils::check_referer()) {
            $error = array('code' => 403, 'message' => "Referer check failed");
            self::raise_error($error, true, true);
        }
    }
249459
def check_in(request, action):
    """"""
    if not request:
        req_str = ""
        for idx, val in enumerate(actions[action]):
            req_str += "\n" + val
        erstr = "Provide a request dict with the following properties:" \
                " %s" % req_str
        raise ValueError(erstr)

    required_fields = actions[action]
    missing = []
    for field in required_fields:
        if not is_key_present(request, field):
            missing.append(field)
    if missing:
        missing_string = ""
        for idx, val in enumerate(missing):
            missing_string += "\n" + val
        erstr = "Provide the required request parameters to" \
                " complete this request: %s" % missing_string
        raise ValueError(erstr)

    return True
720559
private function extensionCheck()
    {
        // Check for required PHP extensions
        $required_extensions = ['PDO', 'curl', 'gd', 'json', 'openssl', 'mbstring'];
        $missing = [];
        foreach ($required_extensions as $extension) {
            if (!extension_loaded($extension)) {
                $missing[] = $extension;
            }
        }
        if (count($missing)) {
            asort($missing);
            $this->console->error('Extension required: ' . implode(', ', $missing));
            $this->errors =  true;
        }
    }