From 195ec4b11e7c39461ab17c0233d3b41dcd450e0e Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 24 Oct 2017 04:59:52 +0200 Subject: [PATCH] * added some compat functions that are used by shop system --- system/functions.php | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/system/functions.php b/system/functions.php index 9c7ee213..05a9131a 100644 --- a/system/functions.php +++ b/system/functions.php @@ -976,4 +976,52 @@ function unsetSession($key) { // validator functions require_once(LIBS . 'validator.php'); + +function check_name($name, &$errors = '') { + if(Validator::characterName($name)) + return true; + + $errors = Validator::getLastError(); + return false; +} + +function check_account_id($id, &$errors = '') { + if(Validator::accountId($id)) + return true; + + $errors = Validator::getLastError(); + return false; +} + +function check_account_name($name, &$errors = '') { + if(Validator::accountName($name)) + return true; + + $errors = Validator::getLastError(); + return false; +} + +function check_name_new_char($name, &$errors = '') { + if(Validator::newCharacterName($name)) + return true; + + $errors = Validator::getLastError(); + return false; +} + +function check_rank_name($name, &$errors = '') { + if(Validator::rankName($name)) + return true; + + $errors = Validator::getLastError(); + return false; +} + +function check_guild_name($name, &$errors = '') { + if(Validator::guildName($name)) + return true; + + $errors = Validator::getLastError(); + return false; +} ?>