Subversion-Projekte lars-tiefland.ci

Revision

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

Revision 2242 Revision 2254
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 - 2018, British Columbia Institute of Technology
9
 * Copyright (c) 2014 - 2017, 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 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
32
 * @copyright	Copyright (c) 2014 - 2017, 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
964
 
965
		{
965
		return 'plain';
966
			return 'plain';
-
 
967
		}
966
	}
968
	}
Zeile 967... Zeile 969...
967
 
969
 
Zeile 968... Zeile 970...
968
	// --------------------------------------------------------------------
970
	// --------------------------------------------------------------------
Zeile 1030... Zeile 1032...
1030
	 * @param	string
1032
	 * @param	string
1031
	 * @return	bool
1033
	 * @return	bool
1032
	 */
1034
	 */
1033
	public function valid_email($email)
1035
	public function valid_email($email)
1034
	{
1036
	{
1035
		if (function_exists('idn_to_ascii') && strpos($email, '@'))
1037
		if (function_exists('idn_to_ascii') && $atpos = strpos($email, '@'))
1036
		{
1038
		{
1037
			list($account, $domain) = explode('@', $email, 2);
1039
			$email = self::substr($email, 0, ++$atpos).idn_to_ascii(self::substr($email, $atpos));
1038
			$domain = defined('INTL_IDNA_VARIANT_UTS46')
-
 
1039
				? idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46)
-
 
1040
				: idn_to_ascii($domain);
-
 
1041
 
-
 
1042
			if ($domain !== FALSE)
-
 
1043
			{
-
 
1044
				$email = $account.'@'.$domain;
-
 
1045
			}
-
 
1046
		}
1040
		}
Zeile 1047... Zeile 1041...
1047
 
1041
 
1048
		return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
1042
		return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
Zeile 1855... Zeile 1849...
1855
	 * @param	string	$email
1849
	 * @param	string	$email
1856
	 * @return	bool
1850
	 * @return	bool
1857
	 */
1851
	 */
1858
	protected function _validate_email_for_shell(&$email)
1852
	protected function _validate_email_for_shell(&$email)
1859
	{
1853
	{
1860
		if (function_exists('idn_to_ascii') && strpos($email, '@'))
1854
		if (function_exists('idn_to_ascii') && $atpos = strpos($email, '@'))
1861
		{
1855
		{
1862
			list($account, $domain) = explode('@', $email, 2);
1856
			$email = self::substr($email, 0, ++$atpos).idn_to_ascii(self::substr($email, $atpos));
1863
			$domain = defined('INTL_IDNA_VARIANT_UTS46')
-
 
1864
				? idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46)
-
 
1865
				: idn_to_ascii($domain);
-
 
1866
 
-
 
1867
			if ($domain !== FALSE)
-
 
1868
			{
-
 
1869
				$email = $account.'@'.$domain;
-
 
1870
			}
-
 
1871
		}
1857
		}
Zeile 1872... Zeile 1858...
1872
 
1858
 
1873
		return (filter_var($email, FILTER_VALIDATE_EMAIL) === $email && preg_match('#\A[a-z0-9._+-]+@[a-z0-9.-]{1,253}\z#i', $email));
1859
		return (filter_var($email, FILTER_VALIDATE_EMAIL) === $email && preg_match('#\A[a-z0-9._+-]+@[a-z0-9.-]{1,253}\z#i', $email));
Zeile 2080... Zeile 2066...
2080
		if ($this->smtp_crypto === 'tls')
2066
		if ($this->smtp_crypto === 'tls')
2081
		{
2067
		{
2082
			$this->_send_command('hello');
2068
			$this->_send_command('hello');
2083
			$this->_send_command('starttls');
2069
			$this->_send_command('starttls');
Zeile 2084... Zeile -...
2084
 
-
 
2085
			/**
-
 
2086
			 * STREAM_CRYPTO_METHOD_TLS_CLIENT is quite the mess ...
-
 
2087
			 *
-
 
2088
			 * - On PHP <5.6 it doesn't even mean TLS, but SSL 2.0, and there's no option to use actual TLS
-
 
2089
			 * - On PHP 5.6.0-5.6.6, >=7.2 it means negotiation with any of TLS 1.0, 1.1, 1.2
-
 
2090
			 * - On PHP 5.6.7-7.1.* it means only TLS 1.0
-
 
2091
			 *
-
 
2092
			 * We want the negotiation, so we'll force it below ...
-
 
2093
			 */
-
 
2094
			$method = is_php('5.6')
-
 
2095
				? STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
-
 
2096
				: STREAM_CRYPTO_METHOD_TLS_CLIENT;
2070
 
Zeile 2097... Zeile 2071...
2097
			$crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, $method);
2071
			$crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT);
2098
 
2072
 
2099
			if ($crypto !== TRUE)
2073
			if ($crypto !== TRUE)
2100
			{
2074
			{
Zeile 2283... Zeile 2257...
2283
				}
2257
				}
Zeile 2284... Zeile 2258...
2284
 
2258
 
2285
				usleep(250000);
2259
				usleep(250000);
2286
				continue;
2260
				continue;
-
 
2261
			}
2287
			}
2262
			else
2288
 
2263
			{
-
 
2264
				$timestamp = 0;
2289
			$timestamp = 0;
2265
			}
Zeile 2290... Zeile 2266...
2290
		}
2266
		}
2291
 
2267
 
2292
		if ($result === FALSE)
2268
		if ($result === FALSE)