Skip to content

Commit 1455e8d

Browse files
committed
remove !== "0" check
1 parent 0987c9a commit 1455e8d

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

system/CLI/CLI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public static function prompt(string $field, $options = null, $validation = null
262262
$default = $options[0];
263263
}
264264

265-
static::fwrite(STDOUT, $field . (trim($field) !== '' && trim($field) !== '0' ? ' ' : '') . $extraOutput . ': ');
265+
static::fwrite(STDOUT, $field . (trim($field) !== '' ? ' ' : '') . $extraOutput . ': ');
266266

267267
// Read the input from keyboard.
268268
$input = trim(static::input()) ?: $default;

system/Config/DotEnv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function normaliseVariable(string $name, string $value = ''): array
140140
*/
141141
protected function sanitizeValue(string $value): string
142142
{
143-
if ($value === '' || $value === '0') {
143+
if ($value === '') {
144144
return $value;
145145
}
146146

system/HTTP/DownloadResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private function getContentDisposition(): string
194194

195195
$result = sprintf('attachment; filename="%s"', $downloadFilename);
196196

197-
if ($utf8Filename !== '' && $utf8Filename !== '0') {
197+
if ($utf8Filename !== '') {
198198
$result .= '; filename*=UTF-8\'\'' . rawurlencode($utf8Filename);
199199
}
200200

system/Helpers/form_helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
function form_open(string $action = '', $attributes = [], array $hidden = []): string
3030
{
3131
// If no action is provided then set to the current url
32-
if ($action === '' || $action === '0') {
32+
if ($action === '') {
3333
$action = current_url(true);
3434
} // If an action is not a full URL then turn it into one
3535
elseif (strpos($action, '://') === false) {

system/Helpers/html_helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function doctype(string $type = 'html5'): string
195195
function script_tag($src = '', bool $indexPage = false): string
196196
{
197197
$cspNonce = csp_script_nonce();
198-
$cspNonce = $cspNonce !== '' && $cspNonce !== '0' ? ' ' . $cspNonce : $cspNonce;
198+
$cspNonce = $cspNonce !== '' ? ' ' . $cspNonce : $cspNonce;
199199
$script = '<script' . $cspNonce . ' ';
200200
if (! is_array($src)) {
201201
$src = ['src' => $src];

system/Helpers/url_helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ function safe_mailto(string $email, string $title = '', $attributes = ''): strin
318318

319319
// improve obfuscation by eliminating newlines & whitespace
320320
$cspNonce = csp_script_nonce();
321-
$cspNonce = $cspNonce !== '' && $cspNonce !== '0' ? ' ' . $cspNonce : $cspNonce;
321+
$cspNonce = $cspNonce !== '' ? ' ' . $cspNonce : $cspNonce;
322322
$output = '<script' . $cspNonce . '>'
323323
. 'var l=new Array();';
324324

system/Router/RouteCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ public function group(string $name, ...$params)
767767
// To register a route, we'll set a flag so that our router
768768
// will see the group name.
769769
// If the group name is empty, we go on using the previously built group name.
770-
$this->group = $name !== '' && $name !== '0' ? trim($oldGroup . '/' . $name, '/') : $oldGroup;
770+
$this->group = $name !== '' ? trim($oldGroup . '/' . $name, '/') : $oldGroup;
771771

772772
$callback = array_pop($params);
773773

system/Session/Handlers/FileHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function __construct(SessionConfig $config, string $ipAddress)
7373
} else {
7474
$sessionPath = rtrim(ini_get('session.save_path'), '/\\');
7575

76-
if ($sessionPath === '' || $sessionPath === '0') {
76+
if ($sessionPath === '') {
7777
$sessionPath = WRITEPATH . 'session';
7878
}
7979

0 commit comments

Comments
 (0)