����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 3.15.3.240 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/ideyshare.name.ng/app/helpers/ |
Upload File : |
<?php namespace App\Helpers; class ValidationHelper { // makes sure all content is made safe when outputted to screen static function safeOutputToScreen($input, $allowedChars = null, $length = null) { if ($allowedChars != null) { $input = self::removeInvalidCharacters($input, $allowedChars); } if ($length != null) { if (strlen($input) > $length) { $input = substr($input, 0, $length - 3) . '...'; } } $input = htmlspecialchars($input, ENT_QUOTES, "UTF-8"); return $input; } // tests for a valid email address and optionally tests for valid MX records, too. static function validEmail($email) { return filter_var($email, FILTER_VALIDATE_EMAIL); } static function validUsername($username) { return preg_match('/^[a-zA-Z0-9_]+$/', $username); } static function containsInvalidCharacters($input, $allowedChars = 'abcdefghijklmnopqrstuvwxyz 1234567890') { if (self::removeInvalidCharacters($input, $allowedChars) != $input) { return true; } return false; } static function removeInvalidCharacters($input, $allowedChars = 'abcdefghijklmnopqrstuvwxyz 1234567890') { $str = ''; for ($i = 0; $i < strlen($input); $i++) { if (!stristr($allowedChars, $input[$i])) { continue; } $str .= $input[$i]; } return $str; } static function validDate($date, $format = 'Y-m-d H:i:s') { $d = \DateTime::createFromFormat($format, $date); return $d && $d->format($format) == $date; } static function validIPAddress($ipAddress) { return filter_var($ipAddress, FILTER_VALIDATE_IP); } }