mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-11 23:48:07 +00:00
fix keyword topic validation
This commit is contained in:
parent
8586d713ef
commit
fda862928b
@ -103,7 +103,7 @@ define('MAGNET_DN_MIN_LENGTH', 10);
|
|||||||
define('MAGNET_DN_MAX_LENGTH', 255);
|
define('MAGNET_DN_MAX_LENGTH', 255);
|
||||||
define('MAGNET_DN_REGEX', '/.*/ui');
|
define('MAGNET_DN_REGEX', '/.*/ui');
|
||||||
|
|
||||||
define('MAGNET_KT_MIN_LENGTH', 10);
|
define('MAGNET_KT_MIN_LENGTH', 2);
|
||||||
define('MAGNET_KT_MAX_LENGTH', 140);
|
define('MAGNET_KT_MAX_LENGTH', 140);
|
||||||
define('MAGNET_KT_REGEX', '/[\w]+/ui');
|
define('MAGNET_KT_REGEX', '/[\w]+/ui');
|
||||||
define('MAGNET_KT_MIN_QUANTITY', 0);
|
define('MAGNET_KT_MIN_QUANTITY', 0);
|
||||||
|
@ -637,7 +637,7 @@ class Valid
|
|||||||
|
|
||||||
foreach ($value as $kt)
|
foreach ($value as $kt)
|
||||||
{
|
{
|
||||||
if (!is_string($value))
|
if (!is_string($kt))
|
||||||
{
|
{
|
||||||
array_push(
|
array_push(
|
||||||
$error,
|
$error,
|
||||||
@ -647,7 +647,7 @@ class Valid
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match(MAGNET_KT_REGEX, $value))
|
if (!preg_match(MAGNET_KT_REGEX, $kt))
|
||||||
{
|
{
|
||||||
array_push(
|
array_push(
|
||||||
$error,
|
$error,
|
||||||
@ -660,8 +660,8 @@ class Valid
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mb_strlen($value) < MAGNET_KT_MIN_LENGTH ||
|
if (mb_strlen($kt) < MAGNET_KT_MIN_LENGTH ||
|
||||||
mb_strlen($value) > MAGNET_KT_MAX_LENGTH)
|
mb_strlen($kt) > MAGNET_KT_MAX_LENGTH)
|
||||||
{
|
{
|
||||||
array_push(
|
array_push(
|
||||||
$error,
|
$error,
|
||||||
|
Loading…
Reference in New Issue
Block a user