Skip to content

Commit 4c7ed50

Browse files
committed
Merge branch 'develop' of github.com:bcit-ci/CodeIgniter4 into develop
2 parents 1ce814b + 33f9308 commit 4c7ed50

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

system/Files/File.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ public function guessExtension(): ?string
134134
*/
135135
public function getMimeType(): string
136136
{
137+
if (! function_exists('finfo_open'))
138+
{
139+
return $this->originalMimeType ?? 'application/octet-stream';
140+
}
141+
137142
$finfo = finfo_open(FILEINFO_MIME_TYPE);
138143
$mimeType = finfo_file($finfo, $this->getRealPath());
139144
finfo_close($finfo);

system/Honeypot/Honeypot.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<?php
2-
3-
42
/**
53
* CodeIgniter
64
*
@@ -107,7 +105,7 @@ public function attachHoneypot(ResponseInterface $response)
107105
$prep_field = $this->prepareTemplate($this->config->template);
108106

109107
$body = $response->getBody();
110-
$body = str_ireplace('</form>', $prep_field, $body);
108+
$body = str_ireplace('</form>', $prep_field . '</form>', $body);
111109
$response->setBody($body);
112110
}
113111

0 commit comments

Comments
 (0)