Commit 3f074e75 authored by Tino Goratsch's avatar Tino Goratsch

deprecated most of the old validation rule implementations

parent 593fda4b
......@@ -6,6 +6,8 @@ use ACP3\Core;
/**
* Class ACL
* @package ACP3\Core\Validator\Rules
*
* @deprecated
*/
class ACL
{
......@@ -30,6 +32,8 @@ class ACL
* Array mit den IDs der zu überprüfenden Privilegien mit ihren Berechtigungen
*
* @return boolean
*
* @deprecated
*/
public function aclPrivilegesExist(array $privileges)
{
......
......@@ -6,6 +6,8 @@ use ACP3\Core;
/**
* Class Captcha
* @package ACP3\Core\Validator\Rules
*
* @deprecated
*/
class Captcha
{
......@@ -45,6 +47,8 @@ class Captcha
* @param string $path
*
* @return boolean
*
* @deprecated
*/
public function captcha($input, $path = '')
{
......
......@@ -4,6 +4,8 @@ namespace ACP3\Core\Validator\Rules;
/**
* Class Date
* @package ACP3\Core\Validator\Rules
*
* @deprecated
*/
class Date
{
......@@ -36,6 +38,8 @@ class Date
* Enddatum
*
* @return boolean
*
* @deprecated
*/
public function date($start, $end = null)
{
......
......@@ -6,6 +6,8 @@ use ACP3\Core;
/**
* Class Mime
* @package ACP3\Core\Validator\Rules
*
* @deprecated
*/
class Mime
{
......@@ -32,6 +34,8 @@ class Mime
* @param string $filesize
*
* @return boolean
*
* @deprecated
*/
public function isPicture($file, $width = '', $height = '', $filesize = '')
{
......@@ -64,6 +68,8 @@ class Mime
* Der zu vergleichende MIMETYPE
*
* @return mixed
*
* @deprecated
*/
public function mimeType($file, $mimetype = '')
{
......
......@@ -8,6 +8,8 @@ use ACP3\Core\SessionHandler;
/**
* Class Misc
* @package ACP3\Core
*
* @deprecated
*/
class Misc
{
......@@ -43,6 +45,8 @@ class Misc
* Zu überprüfende E-Mail-Adresse
*
* @return boolean
*
* @deprecated
*/
public function email($var)
{
......@@ -58,6 +62,8 @@ class Misc
* Validiert das Formtoken auf seine Gültigkeit
*
* @return boolean
*
* @deprecated
*/
public function formToken()
{
......@@ -74,6 +80,8 @@ class Misc
* @param string $string
*
* @return boolean
*
* @deprecated
*/
public function isMD5($string)
{
......@@ -86,6 +94,8 @@ class Misc
* @param mixed $var
*
* @return boolean
*
* @deprecated
*/
public function isNumber($var)
{
......
......@@ -14,6 +14,8 @@ class Router
* @param string $var
*
* @return boolean
*
* @deprecated
*/
public function isUriSafe($var)
{
......@@ -26,6 +28,8 @@ class Router
* @param mixed $var
*
* @return boolean
*
* @deprecated
*/
public function isInternalURI($var)
{
......
......@@ -7,29 +7,26 @@ use ACP3\Modules\ACP3\Seo;
/**
* Class Aliases
* @package ACP3\Core\Validator\Rules\Router
*
* @deprecated
*/
class Aliases
{
/**
* @var \ACP3\Core\Validator\Rules\Router
* @var \ACP3\Modules\ACP3\Seo\Validator\ValidationRules\UriAliasValidationRule
*/
protected $routerValidator;
/**
* @var \ACP3\Modules\ACP3\Seo\Model\SeoRepository
*/
protected $seoRepository;
protected $uriAliasValidationRule;
/**
* @param \ACP3\Core\Validator\Rules\Router $routerValidator
* @param \ACP3\Modules\ACP3\Seo\Model\SeoRepository $seoRepository
* Aliases constructor.
*
* @param \ACP3\Modules\ACP3\Seo\Validator\ValidationRules\UriAliasValidationRule $uriAliasValidationRule
*/
public function __construct(
Core\Validator\Rules\Router $routerValidator,
Seo\Model\SeoRepository $seoRepository
Seo\Validator\ValidationRules\UriAliasValidationRule $uriAliasValidationRule
)
{
$this->routerValidator = $routerValidator;
$this->seoRepository = $seoRepository;
$this->uriAliasValidationRule = $uriAliasValidationRule;
}
/**
......@@ -39,21 +36,11 @@ class Aliases
* @param string $path
*
* @return boolean
*
* @deprecated
*/
public function uriAliasExists($alias, $path = '')
{
if ($this->routerValidator->isUriSafe($alias)) {
if (is_dir(MODULES_DIR . $alias) === true) {
return true;
} else {
$path .= !preg_match('=/$=', $path) ? '/' : '';
if ($path !== '/' && $this->routerValidator->isInternalURI($path) === true) {
return $this->seoRepository->uriAliasExistsByAlias($alias, $path);
} elseif ($this->seoRepository->uriAliasExistsByAlias($alias) === true) {
return true;
}
}
}
return false;
return $this->uriAliasValidationRule->isValid($alias, '', ['path' => $path]);
}
}
......@@ -99,4 +99,4 @@ services:
core.validator.rules.router.aliases:
class: ACP3\Core\Validator\Rules\Router\Aliases
arguments: ['@core.validator.rules.router', '@seo.model.seorepository']
arguments: [@seo.validator.validation_rules.uri_alias_validation_rule]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment