Subversion-Projekte lars-tiefland.ci

Revision

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

Revision 2049 Revision 2107
Zeile 373... Zeile 373...
373
		4 => '4 (Low)',
373
		4 => '4 (Low)',
374
		5 => '5 (Lowest)'
374
		5 => '5 (Lowest)'
375
	);
375
	);
Zeile 376... Zeile 376...
376
 
376
 
377
	/**
377
	/**
378
	 * mbstring.func_override flag
378
	 * mbstring.func_overload flag
379
	 *
379
	 *
380
	 * @var	bool
380
	 * @var	bool
381
	 */
381
	 */
Zeile 382... Zeile 382...
382
	protected static $func_override;
382
	protected static $func_overload;
Zeile 383... Zeile 383...
383
 
383
 
384
	// --------------------------------------------------------------------
384
	// --------------------------------------------------------------------
Zeile 395... Zeile 395...
395
	{
395
	{
396
		$this->charset = config_item('charset');
396
		$this->charset = config_item('charset');
397
		$this->initialize($config);
397
		$this->initialize($config);
398
		$this->_safe_mode = ( ! is_php('5.4') && ini_get('safe_mode'));
398
		$this->_safe_mode = ( ! is_php('5.4') && ini_get('safe_mode'));
Zeile 399... Zeile 399...
399
 
399
 
Zeile 400... Zeile 400...
400
		isset(self::$func_override) OR self::$func_override = (extension_loaded('mbstring') && ini_get('mbstring.func_override'));
400
		isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));
401
 
401
 
Zeile 402... Zeile 402...
402
		log_message('info', 'Email Class Initialized');
402
		log_message('info', 'Email Class Initialized');
Zeile 911... Zeile 911...
911
	// --------------------------------------------------------------------
911
	// --------------------------------------------------------------------
Zeile 912... Zeile 912...
912
 
912
 
913
	/**
913
	/**
914
	 * Get Mail Protocol
914
	 * Get Mail Protocol
915
	 *
-
 
916
	 * @param	bool
915
	 *
917
	 * @return	mixed
916
	 * @return	mixed
918
	 */
917
	 */
919
	protected function _get_protocol($return = TRUE)
918
	protected function _get_protocol()
920
	{
919
	{
921
		$this->protocol = strtolower($this->protocol);
920
		$this->protocol = strtolower($this->protocol);
922
		in_array($this->protocol, $this->_protocols, TRUE) OR $this->protocol = 'mail';
-
 
923
 
-
 
924
		if ($return === TRUE)
-
 
925
		{
921
		in_array($this->protocol, $this->_protocols, TRUE) OR $this->protocol = 'mail';
926
			return $this->protocol;
-
 
927
		}
922
		return $this->protocol;
Zeile 928... Zeile 923...
928
	}
923
	}
Zeile 929... Zeile 924...
929
 
924
 
930
	// --------------------------------------------------------------------
925
	// --------------------------------------------------------------------
931
 
926
 
932
	/**
-
 
933
	 * Get Mail Encoding
927
	/**
934
	 *
928
	 * Get Mail Encoding
935
	 * @param	bool
929
	 *
936
	 * @return	string
930
	 * @return	string
937
	 */
931
	 */
Zeile 938... Zeile 932...
938
	protected function _get_encoding($return = TRUE)
932
	protected function _get_encoding()
939
	{
933
	{
940
		in_array($this->_encoding, $this->_bit_depths) OR $this->_encoding = '8bit';
934
		in_array($this->_encoding, $this->_bit_depths) OR $this->_encoding = '8bit';
941
 
935
 
942
		foreach ($this->_base_charsets as $charset)
936
		foreach ($this->_base_charsets as $charset)
943
		{
937
		{
944
			if (strpos($charset, $this->charset) === 0)
938
			if (strpos($this->charset, $charset) === 0)
Zeile 945... Zeile -...
945
			{
-
 
946
				$this->_encoding = '7bit';
-
 
947
			}
939
			{
948
		}
-
 
949
 
940
				$this->_encoding = '7bit';
Zeile 950... Zeile 941...
950
		if ($return === TRUE)
941
			}
Zeile 951... Zeile 942...
951
		{
942
		}
Zeile 1827... Zeile 1818...
1827
	 */
1818
	 */
1828
	protected function _spool_email()
1819
	protected function _spool_email()
1829
	{
1820
	{
1830
		$this->_unwrap_specials();
1821
		$this->_unwrap_specials();
Zeile -... Zeile 1822...
-
 
1822
 
1831
 
1823
		$protocol = $this->_get_protocol();
1832
		$method = '_send_with_'.$this->_get_protocol();
1824
		$method   = '_send_with_'.$protocol;
1833
		if ( ! $this->$method())
1825
		if ( ! $this->$method())
1834
		{
1826
		{
1835
			$this->_set_error_message('lang:email_send_failure_'.($this->_get_protocol() === 'mail' ? 'phpmail' : $this->_get_protocol()));
1827
			$this->_set_error_message('lang:email_send_failure_'.($protocol === 'mail' ? 'phpmail' : $protocol));
1836
			return FALSE;
1828
			return FALSE;
Zeile 1837... Zeile 1829...
1837
		}
1829
		}
1838
 
1830
 
1839
		$this->_set_error_message('lang:email_sent', $this->_get_protocol());
1831
		$this->_set_error_message('lang:email_sent', $protocol);
Zeile 1840... Zeile 1832...
1840
		return TRUE;
1832
		return TRUE;
Zeile 2440... Zeile 2432...
2440
	 * @param	string	$str
2432
	 * @param	string	$str
2441
	 * @return	int
2433
	 * @return	int
2442
	 */
2434
	 */
2443
	protected static function strlen($str)
2435
	protected static function strlen($str)
2444
	{
2436
	{
2445
		return (self::$func_override)
2437
		return (self::$func_overload)
2446
			? mb_strlen($str, '8bit')
2438
			? mb_strlen($str, '8bit')
2447
			: strlen($str);
2439
			: strlen($str);
2448
	}
2440
	}
Zeile 2449... Zeile 2441...
2449
 
2441
 
Zeile 2457... Zeile 2449...
2457
	 * @param	int	$length
2449
	 * @param	int	$length
2458
	 * @return	string
2450
	 * @return	string
2459
	 */
2451
	 */
2460
	protected static function substr($str, $start, $length = NULL)
2452
	protected static function substr($str, $start, $length = NULL)
2461
	{
2453
	{
2462
		if (self::$func_override)
2454
		if (self::$func_overload)
2463
		{
2455
		{
2464
			// mb_substr($str, $start, null, '8bit') returns an empty
2456
			// mb_substr($str, $start, null, '8bit') returns an empty
2465
			// string on PHP 5.3
2457
			// string on PHP 5.3
2466
			isset($length) OR $length = ($start >= 0 ? self::strlen($str) - $start : -$start);
2458
			isset($length) OR $length = ($start >= 0 ? self::strlen($str) - $start : -$start);
2467
			return mb_substr($str, $start, $length, '8bit');
2459
			return mb_substr($str, $start, $length, '8bit');