Source of file Validate.php
Size: 0,975 Bytes - Last Modified: 2013-06-17T15:32:32+02:00
/home/theseer/Downloads/Symfony/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Validate.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344 | <?php /* * This file is part of SwiftMailer. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Utility Class allowing users to simply check expressions again Swift Grammar. * * @package Swift * @author Xavier De Cock <xdecock@gmail.com> */ class Swift_Validate { /** * Grammar Object * * @var Swift_Mime_Grammar */ private static $grammar = null; /** * Checks if an e-mail address matches the current grammars. * * @param string $email * * @return boolean */ public static function email($email) { if (self::$grammar===null) { self::$grammar = Swift_DependencyContainer::getInstance() ->lookup('mime.grammar'); } return preg_match( '/^' . self::$grammar->getDefinition('addr-spec') . '$/D', ); } } |