From 75833e7fbe51f136ad1c41041737c6a7b30e4311 Mon Sep 17 00:00:00 2001 From: Kristoffer Eklund Date: Sat, 20 Jun 2015 18:35:12 +0200 Subject: [PATCH] Recode validate_name() function --- engine/function/general.php | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/engine/function/general.php b/engine/function/general.php index 6cd5108..60db4c1 100644 --- a/engine/function/general.php +++ b/engine/function/general.php @@ -1,4 +1,5 @@ config('maxW')) { - return false; - } else { - return $string; - } + return (str_word_count(trim($string)) > config('maxW')) ? false : trim($string); } // Checks if an IPv4(or localhost IPv6) address is valid