Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI and adjacent packages #551

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions app/Config/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,30 @@ class App extends BaseConfig
*/
public string $uriProtocol = 'REQUEST_URI';

/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible.
|
| By default, only these are allowed: `a-z 0-9~%.:_-`
|
| Set an empty string to allow all characters -- but only if you are insane.
|
| The configured value is actually a regular expression character group
| and it will be used as: '/\A[<permittedURIChars>]+\z/iu'
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
public string $permittedURIChars = 'a-z 0-9~%.:_\-';

/**
* --------------------------------------------------------------------------
* Default Locale
Expand Down
15 changes: 4 additions & 11 deletions app/Views/errors/html/debug.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ body {
}
h1 {
font-weight: lighter;
letter-spacing: 0.8;
font-size: 3rem;
color: var(--dark-text-color);
margin: 0;
Expand All @@ -44,7 +43,7 @@ p.lead {
color: var(--dark-text-color);
}
.header .container {
padding: 1rem 1.75rem 1.75rem 1.75rem;
padding: 1rem;
}
.header h1 {
font-size: 2.5rem;
Expand All @@ -65,14 +64,11 @@ p.lead {
display: inline;
}

.footer {
.environment {
background: var(--dark-bg-color);
color: var(--light-text-color);
}
.footer .container {
border-top: 1px solid #e7e7e7;
margin-top: 1rem;
text-align: center;
padding: 0.2rem;
}

.source {
Expand Down Expand Up @@ -112,7 +108,7 @@ p.lead {
}
.tabs a:link,
.tabs a:visited {
padding: 0rem 1rem;
padding: 0 1rem;
line-height: 2.7;
text-decoration: none;
color: var(--dark-text-color);
Expand Down Expand Up @@ -152,9 +148,6 @@ p.lead {
border-radius: 5px;
color: #31708f;
}
ul, ol {
line-height: 1.8;
}

table {
width: 100%;
Expand Down
63 changes: 28 additions & 35 deletions app/Views/errors/html/error_exception.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
use CodeIgniter\CodeIgniter;
use Config\Services;
use CodeIgniter\CodeIgniter;

$errorId = uniqid('error', true);
?>
Expand All @@ -23,6 +23,12 @@

<!-- Header -->
<div class="header">
<div class="environment">
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> --
Environment: <?= ENVIRONMENT ?>
</div>
<div class="container">
<h1><?= esc($title), esc($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h1>
<p>
Expand All @@ -48,9 +54,9 @@
<?php
$last = $exception;

while ($prevException = $last->getPrevious()) {
$last = $prevException;
?>
while ($prevException = $last->getPrevious()) {
$last = $prevException;
?>

<pre>
Caused by:
Expand All @@ -63,8 +69,8 @@
</pre>

<?php
}
?>
}
?>
</div>

<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) : ?>
Expand Down Expand Up @@ -92,12 +98,12 @@
<!-- Trace info -->
<?php if (isset($row['file']) && is_file($row['file'])) : ?>
<?php
if (isset($row['function']) && in_array($row['function'], ['include', 'include_once', 'require', 'require_once'], true)) {
echo esc($row['function'] . ' ' . clean_path($row['file']));
} else {
echo esc(clean_path($row['file']) . ' : ' . $row['line']);
}
?>
if (isset($row['function']) && in_array($row['function'], ['include', 'include_once', 'require', 'require_once'], true)) {
echo esc($row['function'] . ' ' . clean_path($row['file']));
} else {
echo esc(clean_path($row['file']) . ' : ' . $row['line']);
}
?>
<?php else: ?>
{PHP internal code}
<?php endif; ?>
Expand All @@ -112,14 +118,14 @@
<table cellspacing="0">

<?php
$params = null;
// Reflection by name is not available for closure function
if (substr($row['function'], -1) !== '}') {
$mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']);
$params = $mirror->getParameters();
}

foreach ($row['args'] as $key => $value) : ?>
$params = null;
// Reflection by name is not available for closure function
if (substr($row['function'], -1) !== '}') {
$mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']);
$params = $mirror->getParameters();
}

foreach ($row['args'] as $key => $value) : ?>
<tr>
<td><code><?= esc(isset($params[$key]) ? '$' . $params[$key]->name : "#{$key}") ?></code></td>
<td><pre><?= esc(print_r($value, true)) ?></pre></td>
Expand Down Expand Up @@ -327,8 +333,8 @@
<!-- Response -->
<?php
$response = Services::response();
$response->setStatusCode(http_response_code());
?>
$response->setStatusCode(http_response_code());
?>
<div class="content" id="response">
<table>
<tr>
Expand Down Expand Up @@ -401,18 +407,5 @@
</div> <!-- /container -->
<?php endif; ?>

<div class="footer">
<div class="container">

<p>
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> --
Environment: <?= ENVIRONMENT ?>
</p>

</div>
</div>

</body>
</html>
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"require": {
"php": "^8.1",
"codeigniter4/framework": "^4.4",
"friendsofphp/php-cs-fixer": "^3.51",
"friendsofphp/php-cs-fixer": "^3.52",
"nexusphp/cs-config": "^3.22",
"nikic/php-parser": "^5.0",
"pdepend/pdepend": "^2.16",
Expand Down
Loading
Loading