From d261b1e89c3d4d5191036d5a5660ef6764e593a0 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:12:16 +0100 Subject: Replaced `==` with `===` and `!=` with `!==` in /system/libraries --- system/libraries/Xmlrpcs.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 1853906ea..be930b0f9 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -208,7 +208,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // Get Data //------------------------------------- - if ($data == '') + if ($data === '') { $data = $HTTP_RAW_POST_DATA; } @@ -305,7 +305,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // Check to see if it is a system call $system_call = (strncmp($methName, 'system', 5) === 0); - if ($this->xss_clean == FALSE) + if ($this->xss_clean === FALSE) { $m->xss_clean = FALSE; } @@ -324,7 +324,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc //------------------------------------- $method_parts = explode('.', $this->methods[$methName]['function']); - $objectCall = (isset($method_parts[1]) && $method_parts[1] != ''); + $objectCall = (isset($method_parts[1]) && $method_parts[1] !== ''); if ($system_call === TRUE) { @@ -356,9 +356,9 @@ class CI_Xmlrpcs extends CI_Xmlrpc for ($n = 0, $mc = count($m->params); $n < $mc; $n++) { $p = $m->params[$n]; - $pt = ($p->kindOf() == 'scalar') ? $p->scalarval() : $p->kindOf(); + $pt = ($p->kindOf() === 'scalar') ? $p->scalarval() : $p->kindOf(); - if ($pt != $current_sig[$n+1]) + if ($pt !== $current_sig[$n+1]) { $pno = $n+1; $wanted = $current_sig[$n+1]; @@ -527,7 +527,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $attempt = $this->_execute($m); - if ($attempt->faultCode() != 0) + if ($attempt->faultCode() !== 0) { return $attempt; } @@ -567,7 +567,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc */ public function do_multicall($call) { - if ($call->kindOf() != 'struct') + if ($call->kindOf() !== 'struct') { return $this->multicall_error('notstruct'); } @@ -577,13 +577,13 @@ class CI_Xmlrpcs extends CI_Xmlrpc } list($scalar_type,$scalar_value)=each($methName->me); - $scalar_type = $scalar_type == $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; + $scalar_type = $scalar_type === $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; - if ($methName->kindOf() != 'scalar' OR $scalar_type != 'string') + if ($methName->kindOf() !== 'scalar' OR $scalar_type !== 'string') { return $this->multicall_error('notstring'); } - elseif ($scalar_value == 'system.multicall') + elseif ($scalar_value === 'system.multicall') { return $this->multicall_error('recursion'); } @@ -591,7 +591,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc { return $this->multicall_error('noparams'); } - elseif ($params->kindOf() != 'array') + elseif ($params->kindOf() !== 'array') { return $this->multicall_error('notarray'); } @@ -606,7 +606,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $result = $this->_execute($msg); - if ($result->faultCode() != 0) + if ($result->faultCode() !== 0) { return $this->multicall_error($result); } -- cgit v1.2.3-24-g4f1b From 3dad2e714189b992248261c78d780b322b3c73da Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 14 Jun 2012 15:10:56 +0300 Subject: Replace strncmp() usage with strpos() --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index be930b0f9..e81f2ca9a 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -303,7 +303,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $methName = $m->method_name; // Check to see if it is a system call - $system_call = (strncmp($methName, 'system', 5) === 0); + $system_call = (strpos($methName, 'system') === 0); if ($this->xss_clean === FALSE) { -- cgit v1.2.3-24-g4f1b From afee226aa4487b3645fb916f99b4cf7f012af536 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sun, 15 Jul 2012 18:59:01 +0100 Subject: Changed TRUE and FALSE values to be uppercase --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index e81f2ca9a..5d01d374d 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -230,7 +230,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc ); xml_set_object($parser, $parser_object); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, TRUE); xml_set_element_handler($parser, 'open_tag', 'closing_tag'); xml_set_character_data_handler($parser, 'character_data'); //xml_set_default_handler($parser, 'default_handler'); -- cgit v1.2.3-24-g4f1b