system/libraries/Email.php
/**
		* Validate email for shell
		*
		* Applies stricter, shell-safe validation to email addresses.
		* Introduced to prevent RCE via sendmail's -f option.
		*
		* @see	https://github.com/bcit-ci/CodeIgniter/issues/4963
		* @see	https://gist.github.com/Zenexer/40d02da5e07f151adeaeeaa11af9ab36
		* @license	https://creativecommons.org/publicdomain/zero/1.0/	CC0 1.0, Public Domain
		*
		* Credits for the base concept go to Paul Buonopane <paul@namepros.com>
		*
		* @param	string	$email
		* @return	bool
		*/
Validate email for shell
Applies stricter, shell-safe validation to email addresses.
Introduced to prevent RCE via sendmail's -f option.



Credits for the base concept go to Paul Buonopane 

@param        string  $email
@return       bool
Validate email for shell Applies stricter shell - safe validation to email addresses . Introduced to prevent RCE via sendmail ' s - f option . Credits for the base concept go to Paul Buonopane @param string $email @return bool
protected function _validate_email_for_shell(&$email)
		{
			if (function_exists('idn_to_ascii') && $atpos = strpos($email, '@'))
			{
				$email = self::substr($email, 0, ++$atpos).idn_to_ascii(self::substr($email, $atpos));
			}
			return (filter_var($email, FILTER_VALIDATE_EMAIL) === $email && preg_match('#\A[a-z0-9._+-]+@[a-z0-9.-]{1,253}\z#i', $email));
		}
protected function _validate_email_for_shell ( & $ email ) { if ( function_exists ( 'idn_to_ascii' ) && $ atpos = strpos ( $ email , '@' ) ) { $ email = self :: substr ( $ email , 0 , ++ $ atpos ) . idn_to_ascii ( self :: substr ( $ email , $ atpos ) ) ; } return ( filter_var ( $ email , FILTER_VALIDATE_EMAIL ) === $ email && preg_match ( '#\A[a-z0-9._+-]+@[a-z0-9.-]{1,253}\z#i' , $ email ) ) ; }
Validate email for shell
 Applies stricter, shell-safe validation to email addresses.
Validate email for shell Applies stricter shell - safe validation to email addresses .