Skip to content

Commit

Permalink
Fix "malformed header" error in php-fpm installations
Browse files Browse the repository at this point in the history
Thanks @dkyme for reporting this, see picocms/Pico#378 (comment)
  • Loading branch information
PhrozenByte committed Jan 14, 2017
1 parent 9621e72 commit e128636
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PicoAdmin/PicoAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function handleAdminRequest()
// when only a single module is registered, redirect to the main page of this module
if (count($this->modules) === 1) {
foreach ($this->modules as $moduleName => $module) {
header('307 Temporary Redirect');
header($_SERVER['SERVER_PROTOCOL'] . ' 307 Temporary Redirect');
header('Location: ' . $this->getAdminPageUrl($moduleName));
die();
}
Expand Down
4 changes: 2 additions & 2 deletions PicoAdmin/PicoContentAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function onAdminRequest(&$module, &$action, &$payload)
{
if ($module === 'content') {
if (!$action) {
header('307 Temporary Redirect');
header($_SERVER['SERVER_PROTOCOL'] . ' 307 Temporary Redirect');
header('Location: ' . $this->admin->getAdminPageUrl('content/edit/index'));
die();
} else {
Expand All @@ -118,7 +118,7 @@ public function onAdminRequest(&$module, &$action, &$payload)
}

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

0 comments on commit e128636

Please sign in to comment.