Skip to content

Commit 872c8fb

Browse files
committed
Release v4.2.6
1 parent 26ebf14 commit 872c8fb

38 files changed

+290
-223
lines changed

app/Config/App.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ class App extends BaseConfig
437437
* Defaults to `Lax` as recommended in this link:
438438
*
439439
* @see https://portswigger.net/web-security/csrf/samesite-cookies
440+
*
440441
* @deprecated `Config\Cookie` $samesite property is used.
441442
*
442443
* @var string

app/Config/ContentSecurityPolicy.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
*/
1616
class ContentSecurityPolicy extends BaseConfig
1717
{
18-
//-------------------------------------------------------------------------
18+
// -------------------------------------------------------------------------
1919
// Broadbrush CSP management
20-
//-------------------------------------------------------------------------
20+
// -------------------------------------------------------------------------
2121

2222
/**
2323
* Default CSP report context
@@ -43,10 +43,10 @@ class ContentSecurityPolicy extends BaseConfig
4343
*/
4444
public $upgradeInsecureRequests = false;
4545

46-
//-------------------------------------------------------------------------
46+
// -------------------------------------------------------------------------
4747
// Sources allowed
4848
// Note: once you set a policy to 'none', it cannot be further restricted
49-
//-------------------------------------------------------------------------
49+
// -------------------------------------------------------------------------
5050

5151
/**
5252
* Will default to self if not overridden

app/Config/Routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// where controller filters or CSRF protection are bypassed.
2626
// If you don't want to define all routes, please use the Auto Routing (Improved).
2727
// Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and set the following to true.
28-
//$routes->setAutoRoute(false);
28+
// $routes->setAutoRoute(false);
2929

3030
/*
3131
* --------------------------------------------------------------------

app/Config/Validation.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
class Validation extends BaseConfig
1212
{
13-
//--------------------------------------------------------------------
13+
// --------------------------------------------------------------------
1414
// Setup
15-
//--------------------------------------------------------------------
15+
// --------------------------------------------------------------------
1616

1717
/**
1818
* Stores the classes that contain the
@@ -38,7 +38,7 @@ class Validation extends BaseConfig
3838
'single' => 'CodeIgniter\Validation\Views\single',
3939
];
4040

41-
//--------------------------------------------------------------------
41+
// --------------------------------------------------------------------
4242
// Rules
43-
//--------------------------------------------------------------------
43+
// --------------------------------------------------------------------
4444
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require-dev": {
1818
"codeigniter/coding-standard": "^1.1",
1919
"fakerphp/faker": "^1.9",
20-
"friendsofphp/php-cs-fixer": "3.6.*",
20+
"friendsofphp/php-cs-fixer": "~3.11.0",
2121
"mikey179/vfsstream": "^1.6",
2222
"nexusphp/cs-config": "^3.3",
2323
"phpunit/phpunit": "^9.1",

system/API/ResponseTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ protected function fail($messages, int $status = 400, ?string $code = null, stri
136136
return $this->respond($response, $status, $customMessage);
137137
}
138138

139-
//--------------------------------------------------------------------
139+
// --------------------------------------------------------------------
140140
// Response Helpers
141-
//--------------------------------------------------------------------
141+
// --------------------------------------------------------------------
142142

143143
/**
144144
* Used after successfully creating a new resource.
@@ -290,9 +290,9 @@ protected function failServerError(string $description = 'Internal Server Error'
290290
return $this->fail($description, $this->codes['server_error'], $code, $message);
291291
}
292292

293-
//--------------------------------------------------------------------
293+
// --------------------------------------------------------------------
294294
// Utility Methods
295-
//--------------------------------------------------------------------
295+
// --------------------------------------------------------------------
296296

297297
/**
298298
* Handles formatting a response. Currently makes some heavy assumptions

system/CLI/CLI.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,9 +756,9 @@ public static function wrap(?string $string = null, int $max = 0, int $padLeft =
756756
return $lines;
757757
}
758758

759-
//--------------------------------------------------------------------
759+
// --------------------------------------------------------------------
760760
// Command-Line 'URI' support
761-
//--------------------------------------------------------------------
761+
// --------------------------------------------------------------------
762762

763763
/**
764764
* Parses the command line it was called from and collects all

system/Cache/Handlers/RedisHandler.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,15 @@ public function increment(string $key, int $offset = 1)
200200
{
201201
$key = static::validateKey($key, $this->prefix);
202202

203-
return $this->redis->hIncrBy($key, 'data', $offset);
203+
return $this->redis->hIncrBy($key, '__ci_value', $offset);
204204
}
205205

206206
/**
207207
* {@inheritDoc}
208208
*/
209209
public function decrement(string $key, int $offset = 1)
210210
{
211-
$key = static::validateKey($key, $this->prefix);
212-
213-
return $this->redis->hIncrBy($key, 'data', -$offset);
211+
return $this->increment($key, -$offset);
214212
}
215213

216214
/**

system/CodeIgniter.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CodeIgniter
4747
/**
4848
* The current version of CodeIgniter Framework
4949
*/
50-
public const CI_VERSION = '4.2.5';
50+
public const CI_VERSION = '4.2.6';
5151

5252
/**
5353
* App startup time.
@@ -730,9 +730,12 @@ protected function generateCacheName(Cache $config): string
730730
}
731731

732732
$uri = $this->request->getUri();
733-
734733
if ($config->cacheQueryString) {
735-
$name = URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath(), $uri->getQuery());
734+
if (is_array($config->cacheQueryString)) {
735+
$name = URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath(), $uri->getQuery(['only' => $config->cacheQueryString]));
736+
} else {
737+
$name = URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath(), $uri->getQuery());
738+
}
736739
} else {
737740
$name = URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath());
738741
}
@@ -945,11 +948,9 @@ protected function display404errors(PageNotFoundException $e)
945948
$this->response->setStatusCode($e->getCode());
946949

947950
if (ENVIRONMENT !== 'testing') {
948-
// @codeCoverageIgnoreStart
949951
if (ob_get_level() > 0) {
950-
ob_end_flush();
952+
ob_end_flush(); // @codeCoverageIgnore
951953
}
952-
// @codeCoverageIgnoreEnd
953954
}
954955
// When testing, one is for phpunit, another is for test case.
955956
elseif (ob_get_level() > 2) {

system/Config/BaseService.php

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -92,43 +92,43 @@
9292
* @see http://blog.ircmaxell.com/2015/11/simple-easy-risk-and-change.html
9393
* @see http://www.infoq.com/presentations/Simple-Made-Easy
9494
*
95-
* @method static CacheInterface cache(Cache $config = null, $getShared = true)
96-
* @method static CLIRequest clirequest(App $config = null, $getShared = true)
97-
* @method static CodeIgniter codeigniter(App $config = null, $getShared = true)
98-
* @method static Commands commands($getShared = true)
99-
* @method static void createRequest(App $config, bool $isCli = false)
100-
* @method static ContentSecurityPolicy csp(CSPConfig $config = null, $getShared = true)
101-
* @method static CURLRequest curlrequest($options = [], ResponseInterface $response = null, App $config = null, $getShared = true)
102-
* @method static Email email($config = null, $getShared = true)
103-
* @method static EncrypterInterface encrypter(Encryption $config = null, $getShared = false)
104-
* @method static Exceptions exceptions(ConfigExceptions $config = null, IncomingRequest $request = null, Response $response = null, $getShared = true)
105-
* @method static Filters filters(ConfigFilters $config = null, $getShared = true)
106-
* @method static Format format(ConfigFormat $config = null, $getShared = true)
107-
* @method static Honeypot honeypot(ConfigHoneyPot $config = null, $getShared = true)
108-
* @method static BaseHandler image($handler = null, Images $config = null, $getShared = true)
109-
* @method static IncomingRequest incomingrequest(?App $config = null, bool $getShared = true)
110-
* @method static Iterator iterator($getShared = true)
111-
* @method static Language language($locale = null, $getShared = true)
112-
* @method static Logger logger($getShared = true)
113-
* @method static MigrationRunner migrations(Migrations $config = null, ConnectionInterface $db = null, $getShared = true)
114-
* @method static Negotiate negotiator(RequestInterface $request = null, $getShared = true)
115-
* @method static Pager pager(ConfigPager $config = null, RendererInterface $view = null, $getShared = true)
116-
* @method static Parser parser($viewPath = null, ConfigView $config = null, $getShared = true)
117-
* @method static RedirectResponse redirectresponse(App $config = null, $getShared = true)
118-
* @method static View renderer($viewPath = null, ConfigView $config = null, $getShared = true)
95+
* @method static CacheInterface cache(Cache $config = null, $getShared = true)
96+
* @method static CLIRequest clirequest(App $config = null, $getShared = true)
97+
* @method static CodeIgniter codeigniter(App $config = null, $getShared = true)
98+
* @method static Commands commands($getShared = true)
99+
* @method static void createRequest(App $config, bool $isCli = false)
100+
* @method static ContentSecurityPolicy csp(CSPConfig $config = null, $getShared = true)
101+
* @method static CURLRequest curlrequest($options = [], ResponseInterface $response = null, App $config = null, $getShared = true)
102+
* @method static Email email($config = null, $getShared = true)
103+
* @method static EncrypterInterface encrypter(Encryption $config = null, $getShared = false)
104+
* @method static Exceptions exceptions(ConfigExceptions $config = null, IncomingRequest $request = null, Response $response = null, $getShared = true)
105+
* @method static Filters filters(ConfigFilters $config = null, $getShared = true)
106+
* @method static Format format(ConfigFormat $config = null, $getShared = true)
107+
* @method static Honeypot honeypot(ConfigHoneyPot $config = null, $getShared = true)
108+
* @method static BaseHandler image($handler = null, Images $config = null, $getShared = true)
109+
* @method static IncomingRequest incomingrequest(?App $config = null, bool $getShared = true)
110+
* @method static Iterator iterator($getShared = true)
111+
* @method static Language language($locale = null, $getShared = true)
112+
* @method static Logger logger($getShared = true)
113+
* @method static MigrationRunner migrations(Migrations $config = null, ConnectionInterface $db = null, $getShared = true)
114+
* @method static Negotiate negotiator(RequestInterface $request = null, $getShared = true)
115+
* @method static Pager pager(ConfigPager $config = null, RendererInterface $view = null, $getShared = true)
116+
* @method static Parser parser($viewPath = null, ConfigView $config = null, $getShared = true)
117+
* @method static RedirectResponse redirectresponse(App $config = null, $getShared = true)
118+
* @method static View renderer($viewPath = null, ConfigView $config = null, $getShared = true)
119119
* @method static IncomingRequest|CLIRequest request(App $config = null, $getShared = true)
120-
* @method static Response response(App $config = null, $getShared = true)
121-
* @method static Router router(RouteCollectionInterface $routes = null, Request $request = null, $getShared = true)
122-
* @method static RouteCollection routes($getShared = true)
123-
* @method static Security security(App $config = null, $getShared = true)
124-
* @method static Session session(App $config = null, $getShared = true)
125-
* @method static Throttler throttler($getShared = true)
126-
* @method static Timer timer($getShared = true)
127-
* @method static Toolbar toolbar(ConfigToolbar $config = null, $getShared = true)
128-
* @method static Typography typography($getShared = true)
129-
* @method static URI uri($uri = null, $getShared = true)
130-
* @method static Validation validation(ConfigValidation $config = null, $getShared = true)
131-
* @method static Cell viewcell($getShared = true)
120+
* @method static Response response(App $config = null, $getShared = true)
121+
* @method static Router router(RouteCollectionInterface $routes = null, Request $request = null, $getShared = true)
122+
* @method static RouteCollection routes($getShared = true)
123+
* @method static Security security(App $config = null, $getShared = true)
124+
* @method static Session session(App $config = null, $getShared = true)
125+
* @method static Throttler throttler($getShared = true)
126+
* @method static Timer timer($getShared = true)
127+
* @method static Toolbar toolbar(ConfigToolbar $config = null, $getShared = true)
128+
* @method static Typography typography($getShared = true)
129+
* @method static URI uri($uri = null, $getShared = true)
130+
* @method static Validation validation(ConfigValidation $config = null, $getShared = true)
131+
* @method static Cell viewcell($getShared = true)
132132
*/
133133
class BaseService
134134
{

0 commit comments

Comments
 (0)