Skip to content

Commit 3b1d111

Browse files
authored
Merge pull request #18 from nguyenanhung/v3.1.14-develop
Update fix core CodeIgniter
2 parents effe4d4 + 5a80c2f commit 3b1d111

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

custom/HungNG_CI_Base_Controller_Filename_Checker.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class HungNG_CI_Base_Controller_Filename_Checker extends HungNG_CI_Base_Controll
1313
{
1414
protected $dir;
1515
protected $output_ = array();
16-
protected $fix = false;
16+
protected $fix = false;
1717

1818
public function __construct()
1919
{
@@ -99,27 +99,19 @@ private function checkFilename($filepath, $dir)
9999
}
100100

101101
return false;
102-
} else {
103-
return true;
104102
}
103+
104+
return true;
105105
}
106106

107107
private function checkUcFirst($filename)
108108
{
109-
if (ucfirst($filename) !== $filename) {
110-
return false;
111-
}
112-
113-
return true;
109+
return ucfirst($filename) === $filename;
114110
}
115111

116112
private function hasPrefix($filename, $prefix)
117113
{
118-
if (strncmp($prefix, $filename, bear_str_length($prefix)) === 0) {
119-
return true;
120-
}
121-
122-
return false;
114+
return strncmp($prefix, $filename, bear_str_length($prefix)) === 0;
123115
}
124116
}
125117
}

custom/HungNG_CI_Base_Hooks_Log_Query.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct()
3636
$this->_file_ext = (isset($config['log_file_extension']) && $config['log_file_extension'] !== '') ? ltrim($config['log_file_extension'], '.') : 'php';
3737
$this->_file_prefix = (isset($config['query_log_file_prefix']) && $config['query_log_file_prefix'] !== '') ? rtrim($config['query_log_file_prefix'], '-') . '-' : 'log-';
3838

39-
file_exists($this->_log_path) or mkdir($this->_log_path, 0755, true);
39+
file_exists($this->_log_path) || mkdir($concurrentDirectory = $this->_log_path, 0755, true) || is_dir($concurrentDirectory);
4040

4141
if (!is_dir($this->_log_path) or !is_really_writable($this->_log_path)) {
4242
$this->_enabled = false;
@@ -58,6 +58,9 @@ public function __construct()
5858
}
5959
}
6060

61+
/**
62+
* @throws \Exception
63+
*/
6164
public function run()
6265
{
6366
if ($this->_enabled === false) {

system/database/DB_query_builder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,11 @@ protected function _wh($qb_key, $key, $value = NULL, $type = 'AND ', $escape = N
699699
$k = substr($k, 0, $match[0][1]).($match[1][0] === '=' ? ' IS NULL' : ' IS NOT NULL');
700700
}
701701

702-
${$qb_key} = array('condition' => $prefix.$k, 'value' => $v, 'escape' => $escape);
703-
$this->{$qb_key}[] = ${$qb_key};
702+
$$qb_key = array('condition' => $prefix.$k, 'value' => $v, 'escape' => $escape);
703+
$this->{$qb_key}[] = $$qb_key;
704704
if ($this->qb_caching === TRUE)
705705
{
706-
$this->{$qb_cache_key}[] = ${$qb_key};
706+
$this->{$qb_cache_key}[] = $$qb_key;
707707
$this->qb_cache_exists[] = substr($qb_key, 3);
708708
}
709709

system/libraries/Xmlrpc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1736,7 +1736,7 @@ public function addScalar($val, $type = 'string')
17361736

17371737
if ($typeof != 1)
17381738
{
1739-
echo '<strong>XML_RPC_Values</strong>: not a scalar type (${typeof})<br />';
1739+
echo "<strong>XML_RPC_Values</strong>: not a scalar type ($typeof)<br />";
17401740
return 0;
17411741
}
17421742

system/libraries/Xmlrpcs.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,8 @@ public function multicall($m)
551551
*/
552552
public function multicall_error($err)
553553
{
554-
$str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString();
555-
$code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode();
556-
554+
$str = is_string($err) ? $this->xmlrpcstr["multicall_$err"] : $err->faultString();
555+
$code = is_string($err) ? $this->xmlrpcerr["multicall_$err"] : $err->faultCode();
557556
$struct['faultCode'] = new XML_RPC_Values($code, 'int');
558557
$struct['faultString'] = new XML_RPC_Values($str, 'string');
559558

0 commit comments

Comments
 (0)