Skip to content

Commit e128636

Browse files
committed
Fix "malformed header" error in php-fpm installations
Thanks @dkyme for reporting this, see picocms/Pico#378 (comment)
1 parent 9621e72 commit e128636

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

PicoAdmin/PicoAdmin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function handleAdminRequest()
9999
// when only a single module is registered, redirect to the main page of this module
100100
if (count($this->modules) === 1) {
101101
foreach ($this->modules as $moduleName => $module) {
102-
header('307 Temporary Redirect');
102+
header($_SERVER['SERVER_PROTOCOL'] . ' 307 Temporary Redirect');
103103
header('Location: ' . $this->getAdminPageUrl($moduleName));
104104
die();
105105
}

PicoAdmin/PicoContentAdmin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function onAdminRequest(&$module, &$action, &$payload)
9999
{
100100
if ($module === 'content') {
101101
if (!$action) {
102-
header('307 Temporary Redirect');
102+
header($_SERVER['SERVER_PROTOCOL'] . ' 307 Temporary Redirect');
103103
header('Location: ' . $this->admin->getAdminPageUrl('content/edit/index'));
104104
die();
105105
} else {
@@ -118,7 +118,7 @@ public function onAdminRequest(&$module, &$action, &$payload)
118118
}
119119

120120
if (!$this->page && ($this->action === 'edit')) {
121-
header('307 Temporary Redirect');
121+
header($_SERVER['SERVER_PROTOCOL'] . ' 307 Temporary Redirect');
122122
header('Location: ' . $this->admin->getAdminPageUrl('content/' . $action . '/index'));
123123
die();
124124
}

0 commit comments

Comments
 (0)