Validate include params.
We already define the white lists in the config.

@return bool
@throws UnexpectedIncludesParamException
322393
protected function validateIncludeParams()
    {
        $validParams = array_keys($this->config['include']['params']);
        $usedParams = array_keys(iterator_to_array($this->paramBag));

        if ($invalidParams = array_diff($usedParams, $validParams)) {
            // This validates query string KEY passed by an API client.
            throw new UnexpectedIncludesParamException(
                sprintf(
                    'Used param(s): "%s". Valid param(s): "%s"',
                    implode(',', $usedParams),
                    implode(',', $validParams)
                )
            );
        }

        $errors = [];

        if ($limit = $this->paramBag->get('limit')) {
            if (count($limit) !== 2) {
                array_push(
                    $errors,
                    'Invalid "limit" value. Valid usage: limit(int|int) where the first int is number of items to retrieve and the second is offset to skip over.'
                );
            }

            foreach($limit as $item) {
                if (! is_numeric($item)) {
                    array_push(
                        $errors,
                        'Invalid "limit" value. Expecting: integer. Given: ' . gettype($item) . " \"{$item}\"."
                    );
                }
            }
        }

        if ($sort = $this->paramBag->get('sort')) {
            if (count($sort) !== 2) {
                array_push(
                    $errors,
                    'Invalid "sort" value. Valid usage: sort(string|string) where the first string is attribute name to order by and the second is the sort direction(asc or desc)'
                );
            }

            $allowedSortDirection = ['asc', 'desc'];

            if (isset($sort[1]) && ! in_array(strtolower($sort[1]), $allowedSortDirection)) {
                array_push(
                    $errors,
                    'Invalid "sort" value. Allowed: ' . implode(',', $allowedSortDirection) . ". Given: \"{$sort[1]}\""
                );
            }
        }

        if (! empty($errors)) {
            throw new UnexpectedIncludesParamException(implode(PHP_EOL, $errors));
        }

        return true;
    }
71399
public function getSupportedParams()
    {
        return [
            self::PARAM_INCLUSIONS  => true,
            self::PARAM_FIELDSETS   => true,
            self::PARAM_SORTING     => true,
            self::PARAM_PAGINATION  => true,
            self::PARAM_FILTERING   => true,
        ];
    }
45410
protected static function compileInclude($param)
    {
        $result = '<<<<{include} error!!!>>>>';
        $parameters = self::parseParameters($param);
        if (isset($parameters['file'])) {
            if ('$' != $parameters['file']{0})
                $parameters['file'] = '\'' . $parameters['file'] . '\'';
            $result = "<?php \$this->display({$parameters['file']});?>";
        }

        return $result;
    }
671181
public static function sanitizeParams()
    {
        self::$config['remote'] = [];

        $remote = is_array($_POST['remote']) ? $_POST['remote'] : [];
        foreach ($remote as $complement => $url) {
            $url = filter_var($url, FILTER_VALIDATE_URL);
            if ($url === false) {
                return false;
            }
            self::$config['remote'][$complement] = $url;
        }

        $params = ['id', 'app', 'request', 'filter', 'sort', 'nonce', 'complement'];

        foreach ($params as $param) {
            $value = filter_var($_POST[$param], FILTER_SANITIZE_STRING);
            if ($value === false) {
                return false;
            }
            self::$config[$param] = $value;
        }

        return true;
    }
652696
protected function validateIni()
    {
        $data = $this->configuration;
        if (!isset($data['ini'])) {
            array_push($this->messages, ['error', trans('Unable to read php ini configuration. It is recommended to contact with your provider.')]);
            return $this;
        }
        if (empty(self::$iniRequirements)) {
            return $this;
        }
        $ini = $data['ini'];

        foreach (self::$iniRequirements as $name => $value) {
            if (!isset($ini[$name])) {
                array_push($this->messages, ['error', sprintf('Option (%s) not exists in php ini configuration.', $name)]);
            } else {
                if ($ini[$name]['global_value'] != $value) {
                    array_push($this->messages, ['warning', sprintf('Option (%s) is not same with minimal requirement. Found %s expected %s.', $name, $ini[$name]['global_value'], $value)]);
                }
            }
        }
        return $this;
    }
92545
protected function _validateTermsAndConditions()
    {
        $blValid = true;
        $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if ($oConfig->getConfigParam('blConfirmAGB') && !$oConfig->getRequestParameter('ord_agb')) {
            $blValid = false;
        }

        if ($oConfig->getConfigParam('blEnableIntangibleProdAgreement')) {
            $oBasket = $this->getBasket();

            $blDownloadableProductsAgreement = $oConfig->getRequestParameter('oxdownloadableproductsagreement');
            if ($blValid && $oBasket->hasArticlesWithDownloadableAgreement() && !$blDownloadableProductsAgreement) {
                $blValid = false;
            }

            $blServiceProductsAgreement = $oConfig->getRequestParameter('oxserviceproductsagreement');
            if ($blValid && $oBasket->hasArticlesWithIntangibleAgreement() && !$blServiceProductsAgreement) {
                $blValid = false;
            }
        }

        return $blValid;
    }
1079344
public static function includeRequirements()
    {
        $debugbar = self::getDebugBar();

        if (!$debugbar) {
            return;
        }

        // Already called
        if (self::$renderer) {
            return;
        }

        $renderer = $debugbar->getJavascriptRenderer();

        // We don't need the true path since we are going to use Requirements API that appends the BASE_PATH
        $assetsResource = self::moduleResource('assets');
        $renderer->setBasePath($assetsResource->getRelativePath());
        $renderer->setBaseUrl(Director::makeRelative($assetsResource->getURL()));

        $includeJquery = self::config()->get('include_jquery');
        // In CMS, jQuery is already included
        if (self::isAdminController()) {
            $includeJquery = false;
        }
        // If jQuery is already included, set to false
        $js = Requirements::backend()->getJavascript();
        foreach ($js as $url => $args) {
            $name = basename($url);
            if ($name == 'jquery.js' || $name == 'jquery.min.js') {
                $includeJquery = false;
                break;
            }
        }

        if ($includeJquery) {
            $renderer->setEnableJqueryNoConflict(true);
        } else {
            $renderer->disableVendor('jquery');
            $renderer->setEnableJqueryNoConflict(false);
        }

        if (DebugBar::config()->get('enable_storage')) {
            $renderer->setOpenHandlerUrl('__debugbar');
        }

        foreach ($renderer->getAssets('css') as $cssFile) {
            Requirements::css(Director::makeRelative(ltrim($cssFile, '/')));
        }

        foreach ($renderer->getAssets('js') as $jsFile) {
            Requirements::javascript(Director::makeRelative(ltrim($jsFile, '/')));
        }

        self::$renderer = $renderer;
    }
326602
function include(partial, cb) {
    cb((params.partials && params.partials[partial]) ?
      params.partials[partial] :
      '[error] partial ' + partial + ' does not exist');
  }
1008036
private synchronized boolean isIncluded(String _clazzName) {
        if (includes.size() > 0) {
            for (String include : includes) {
                if (_clazzName.startsWith(include)) {
                    return true;

                }
            }
        } // if we dont have a list, we include nothing (to prevent circular classloader dependencies)
        return false;
    }
629604
protected boolean check(String id, List<String> includes, List<String> excludes) {
		return check(id, includes) && !check(id, excludes);
	}
423679
private function getValidatedIncludes(iterable $includesFromParent): iterable
    {
        $ruleIndexes = $this->serializerClass::readIncludesRuleIndexes($this->getSerializedRuleSet());

        if ($ruleIndexes === null) {
            // without validation
            foreach ($includesFromParent as $path => $split) {
                yield $path => $split;
            }
        } else {
            // with validation
            $ruleIndex = $this->serializerClass::readRuleMainIndex($ruleIndexes);
            $this->validationStarts(static::PARAM_INCLUDE, $ruleIndexes);
            foreach ($includesFromParent as $path => $split) {
                $this->getCaptures()->clear();
                $this->validateAndAccumulateError($path, $ruleIndex);
                if ($this->getCaptures()->count() > 0) {
                    yield $this->readSingleCapturedValue() => $split;
                }
            }
            $this->validateEnds(static::PARAM_INCLUDE, $ruleIndexes);
        }
    }
897289
public function includeJavaScriptValidationAndConditionFiles()
    {
        $javaScriptValidationFiles = $this->getJavaScriptFiles();
        $assetHandlerConnectorStates = $this->assetHandlerConnectorManager
            ->getAssetHandlerConnectorStates();

        foreach ($javaScriptValidationFiles as $file) {
            if (false === in_array($file, $assetHandlerConnectorStates->getAlreadyIncludedValidationJavaScriptFiles())) {
                $assetHandlerConnectorStates->registerIncludedValidationJavaScriptFiles($file);
                $this->includeJsFile(StringService::get()->getResourceRelativePath($file));
            }
        }

        return $this;
    }
298055
public function including($includes)
	{
		if($includes === false)
		{
			$this->model->setIncludes([]);
		}
		else
		{
			$includes = (array) $includes;

			$currentIncludes = $this->model->getIncludes();

			if(!empty($currentIncludes))
			{
				$withCriterion = array_filter(array_keys($includes), 'is_string');

				if(!empty($withCriterion))
				{
					foreach($currentIncludes as $key => $value)
					{
						if(in_array($value, $withCriterion))
						{
							unset($currentIncludes[$key]); // Unset relations that have previously been set without a criterion closure
						}
					}
				}

				$includes = array_merge($currentIncludes, $includes);
			}

			$this->model->setIncludes(array_unique($includes, SORT_REGULAR));
		}

		return $this;
	}
468383
public function listInvalidProperties()
    {
        $invalidProperties = [];

        $allowedValues = $this->getMimeTypeAllowableValues();
        if (!is_null($this->container['mime_type']) && !in_array($this->container['mime_type'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'mime_type', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        return $invalidProperties;
    }
618271
protected function includes()
    {
        $moduleInclude = (array) $this->def('include');
        $globalInclude = $this->app['config']->get('module::include');
        $specificInclude = array($this->name.'.php');
        $include = array_merge($moduleInclude, $specificInclude, $globalInclude);
        foreach ($include as $file)
		{
			$path = $this->path.'/'.$file;
			if ($this->app['files']->exists($path)) require $path;
		}
    }
1230216
public function hasPatterns()
    {
        return (boolean) count($this->includesFileList) > 0 || count($this->excludesFileList) > 0
            || count($this->includeList) > 0 || count($this->excludeList) > 0;
    }
164134
public static function addDefaultExclude($s)
    {
        if (!in_array($s, self::$defaultExcludeList)) {
            $return = true;
            self::$defaultExcludeList[] = $s;
        } else {
            $return = false;
        }

        return $return;
    }