Subversion-Projekte lars-tiefland.ci

Revision

Revision 2254 | Revision 2258 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 2254 Revision 2257
Zeile 4... Zeile 4...
4
 *
4
 *
5
 * An open source application development framework for PHP
5
 * An open source application development framework for PHP
6
 *
6
 *
7
 * This content is released under the MIT License (MIT)
7
 * This content is released under the MIT License (MIT)
8
 *
8
 *
9
 * Copyright (c) 2014 - 2017, British Columbia Institute of Technology
9
 * Copyright (c) 2014 - 2018, British Columbia Institute of Technology
10
 *
10
 *
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
12
 * of this software and associated documentation files (the "Software"), to deal
12
 * of this software and associated documentation files (the "Software"), to deal
13
 * in the Software without restriction, including without limitation the rights
13
 * in the Software without restriction, including without limitation the rights
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Zeile 27... Zeile 27...
27
 * THE SOFTWARE.
27
 * THE SOFTWARE.
28
 *
28
 *
29
 * @package	CodeIgniter
29
 * @package	CodeIgniter
30
 * @author	EllisLab Dev Team
30
 * @author	EllisLab Dev Team
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
32
 * @copyright	Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
32
 * @copyright	Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
33
 * @license	http://opensource.org/licenses/MIT	MIT License
33
 * @license	http://opensource.org/licenses/MIT	MIT License
34
 * @link	https://codeigniter.com
34
 * @link	https://codeigniter.com
35
 * @since	Version 1.0.0
35
 * @since	Version 1.0.0
36
 * @filesource
36
 * @filesource
37
 */
37
 */
Zeile 959... Zeile 959...
959
		}
959
		}
960
		elseif	($this->mailtype === 'text' && ! empty($this->_attachments))
960
		elseif	($this->mailtype === 'text' && ! empty($this->_attachments))
961
		{
961
		{
962
			return 'plain-attach';
962
			return 'plain-attach';
963
		}
963
		}
964
		else
-
 
965
		{
964
 
966
			return 'plain';
965
		return 'plain';
967
		}
-
 
968
	}
966
	}
Zeile 969... Zeile 967...
969
 
967
 
Zeile 970... Zeile 968...
970
	// --------------------------------------------------------------------
968
	// --------------------------------------------------------------------
Zeile 1032... Zeile 1030...
1032
	 * @param	string
1030
	 * @param	string
1033
	 * @return	bool
1031
	 * @return	bool
1034
	 */
1032
	 */
1035
	public function valid_email($email)
1033
	public function valid_email($email)
1036
	{
1034
	{
1037
		if (function_exists('idn_to_ascii') && $atpos = strpos($email, '@'))
1035
		if (function_exists('idn_to_ascii') && strpos($email, '@'))
1038
		{
1036
		{
1039
			$email = self::substr($email, 0, ++$atpos).idn_to_ascii(self::substr($email, $atpos));
1037
			list($account, $domain) = explode('@', $email, 2);
-
 
1038
			$domain = defined('INTL_IDNA_VARIANT_UTS46')
-
 
1039
				? idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46)
-
 
1040
				: idn_to_ascii($domain);
-
 
1041
			$email = $account.'@'.$domain;
1040
		}
1042
		}
Zeile 1041... Zeile 1043...
1041
 
1043
 
1042
		return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
1044
		return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
Zeile 1849... Zeile 1851...
1849
	 * @param	string	$email
1851
	 * @param	string	$email
1850
	 * @return	bool
1852
	 * @return	bool
1851
	 */
1853
	 */
1852
	protected function _validate_email_for_shell(&$email)
1854
	protected function _validate_email_for_shell(&$email)
1853
	{
1855
	{
1854
		if (function_exists('idn_to_ascii') && $atpos = strpos($email, '@'))
1856
		if (function_exists('idn_to_ascii') && strpos($email, '@'))
1855
		{
1857
		{
1856
			$email = self::substr($email, 0, ++$atpos).idn_to_ascii(self::substr($email, $atpos));
1858
			list($account, $domain) = explode('@', $email, 2);
-
 
1859
			$domain = defined('INTL_IDNA_VARIANT_UTS46')
-
 
1860
				? idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46)
-
 
1861
				: idn_to_ascii($domain);
-
 
1862
			$email = $account.'@'.$domain;
1857
		}
1863
		}
Zeile 1858... Zeile 1864...
1858
 
1864
 
1859
		return (filter_var($email, FILTER_VALIDATE_EMAIL) === $email && preg_match('#\A[a-z0-9._+-]+@[a-z0-9.-]{1,253}\z#i', $email));
1865
		return (filter_var($email, FILTER_VALIDATE_EMAIL) === $email && preg_match('#\A[a-z0-9._+-]+@[a-z0-9.-]{1,253}\z#i', $email));
Zeile 2066... Zeile 2072...
2066
		if ($this->smtp_crypto === 'tls')
2072
		if ($this->smtp_crypto === 'tls')
2067
		{
2073
		{
2068
			$this->_send_command('hello');
2074
			$this->_send_command('hello');
2069
			$this->_send_command('starttls');
2075
			$this->_send_command('starttls');
Zeile -... Zeile 2076...
-
 
2076
 
-
 
2077
			/**
-
 
2078
			 * STREAM_CRYPTO_METHOD_TLS_CLIENT is quite the mess ...
-
 
2079
			 *
-
 
2080
			 * - On PHP <5.6 it doesn't even mean TLS, but SSL 2.0, and there's no option to use actual TLS
-
 
2081
			 * - On PHP 5.6.0-5.6.6, >=7.2 it means negotiation with any of TLS 1.0, 1.1, 1.2
-
 
2082
			 * - On PHP 5.6.7-7.1.* it means only TLS 1.0
-
 
2083
			 *
-
 
2084
			 * We want the negotiation, so we'll force it below ...
-
 
2085
			 */
-
 
2086
			$method = is_php('5.6')
-
 
2087
				? STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
2070
 
2088
				: STREAM_CRYPTO_METHOD_TLS_CLIENT;
Zeile 2071... Zeile 2089...
2071
			$crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT);
2089
			$crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, $method);
2072
 
2090
 
2073
			if ($crypto !== TRUE)
2091
			if ($crypto !== TRUE)
2074
			{
2092
			{
Zeile 2257... Zeile 2275...
2257
				}
2275
				}
Zeile 2258... Zeile 2276...
2258
 
2276
 
2259
				usleep(250000);
2277
				usleep(250000);
2260
				continue;
2278
				continue;
2261
			}
-
 
2262
			else
2279
			}
2263
			{
2280
 
2264
				$timestamp = 0;
-
 
2265
			}
2281
			$timestamp = 0;
Zeile 2266... Zeile 2282...
2266
		}
2282
		}
2267
 
2283
 
2268
		if ($result === FALSE)
2284
		if ($result === FALSE)