From bdcafdfa204b041493707caa277915e00a124eaf Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 28 Mar 2017 17:31:09 +0300 Subject: [ci skip] Fix 5070 --- system/libraries/Email.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 955787d28..d4b938701 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -941,7 +941,7 @@ class CI_Email { foreach ($this->_base_charsets as $charset) { - if (strpos($charset, $this->charset) === 0) + if (strpos($this->charset, $charset) === 0) { $this->_encoding = '7bit'; } -- cgit v1.2.3-24-g4f1b From b9e45e32d89f2cba80f88becb0d52c92898e3a1d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 6 Apr 2017 14:36:19 +0300 Subject: [ci skip] Simplify some internal CI_Email code --- system/libraries/Email.php | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Email.php b/system/libraries/Email.php index d4b938701..0e9cf0574 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -913,18 +913,13 @@ class CI_Email { /** * Get Mail Protocol * - * @param bool * @return mixed */ - protected function _get_protocol($return = TRUE) + protected function _get_protocol() { $this->protocol = strtolower($this->protocol); in_array($this->protocol, $this->_protocols, TRUE) OR $this->protocol = 'mail'; - - if ($return === TRUE) - { - return $this->protocol; - } + return $this->protocol; } // -------------------------------------------------------------------- @@ -932,10 +927,9 @@ class CI_Email { /** * Get Mail Encoding * - * @param bool * @return string */ - protected function _get_encoding($return = TRUE) + protected function _get_encoding() { in_array($this->_encoding, $this->_bit_depths) OR $this->_encoding = '8bit'; @@ -947,10 +941,7 @@ class CI_Email { } } - if ($return === TRUE) - { - return $this->_encoding; - } + return $this->_encoding; } // -------------------------------------------------------------------- @@ -1829,14 +1820,15 @@ class CI_Email { { $this->_unwrap_specials(); - $method = '_send_with_'.$this->_get_protocol(); + $protocol = $this->_get_protocol(); + $method = '_send_with_'.$protocol; if ( ! $this->$method()) { - $this->_set_error_message('lang:email_send_failure_'.($this->_get_protocol() === 'mail' ? 'phpmail' : $this->_get_protocol())); + $this->_set_error_message('lang:email_send_failure_'.($protocol === 'mail' ? 'phpmail' : $protocol)); return FALSE; } - $this->_set_error_message('lang:email_sent', $this->_get_protocol()); + $this->_set_error_message('lang:email_sent', $protocol); return TRUE; } -- cgit v1.2.3-24-g4f1b From 11d59d7097ce35ab3b9845de2e021f9db1e25863 Mon Sep 17 00:00:00 2001 From: "Instructor, Computer Systems Technology" Date: Sat, 15 Apr 2017 13:35:10 -0700 Subject: Merge pull request #5085 from jim-parry/fix/xmlrpc Fix typo in serializeval() --- system/libraries/Xmlrpc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index c766a89c8..6fa791864 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -1886,7 +1886,7 @@ class XML_RPC_Values extends CI_Xmlrpc public function serializeval($o) { $array = $o->me; - list($value, $type) = array(reset($ar), key($array)); + list($value, $type) = array(reset($array), key($array)); return "\n".$this->serializedata($type, $value)."\n"; } -- cgit v1.2.3-24-g4f1b From ee9d428171dc201f51eaffdb62616312915681ff Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 5 Jun 2017 10:44:37 +0300 Subject: [ci skip] Merge pull request #5143 from TysonAndre/misc-phpdoc-nits Fix misc inconsistencies between code and doc comments --- system/libraries/Session/drivers/Session_redis_driver.php | 2 +- system/libraries/Table.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index d260f7b82..e220a2951 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -51,7 +51,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle /** * phpRedis instance * - * @var resource + * @var Redis */ protected $_redis; diff --git a/system/libraries/Table.php b/system/libraries/Table.php index fef9bb039..50c5e358b 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -435,7 +435,7 @@ class CI_Table { /** * Set table data from a database result object * - * @param CI_DB_result $db_result Database result object + * @param CI_DB_result $object Database result object * @return void */ protected function _set_from_db_result($object) -- cgit v1.2.3-24-g4f1b From ed1a0453a9372e88058169f2028c9a2140318961 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 19 Jun 2017 08:25:23 +0300 Subject: [ci skip] Fix a bug in FV valid_email() --- system/libraries/Form_validation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 4f679a17f..71d0e64b1 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1229,9 +1229,9 @@ class CI_Form_validation { */ public function valid_email($str) { - if (function_exists('idn_to_ascii') && sscanf($str, '%[^@]@%s', $name, $domain) === 2) + if (function_exists('idn_to_ascii') && preg_match('#\A([^@]+)@(.+)\z#', $str, $matches)) { - $str = $name.'@'.idn_to_ascii($domain); + $str = $matches[1].'@'.idn_to_ascii($matches[2]); } return (bool) filter_var($str, FILTER_VALIDATE_EMAIL); -- cgit v1.2.3-24-g4f1b