Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public function collect()

$data = $GLOBALS[$var];

// Replace Joomla session data from session data, it will be collected by SessionCollector
if ($var === '_SESSION' && !empty($data['joomla'])) {
$data['joomla'] = '***redacted***';
}

array_walk_recursive($data, static function (&$value, $key) {
if (!preg_match(\PlgSystemDebug::PROTECTED_COLLECTOR_KEYS, $key)) {
return;
Expand Down
33 changes: 4 additions & 29 deletions plugins/system/debug/src/JoomlaHttpDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
namespace Joomla\Plugin\System\Debug;

use DebugBar\HttpDriverInterface;
use Joomla\Application\SessionAwareWebApplicationInterface;
use Joomla\Application\WebApplicationInterface;
use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Session\Session;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand All @@ -34,13 +32,6 @@ final class JoomlaHttpDriver implements HttpDriverInterface
*/
private $app;

/**
* @var Session
*
* @since 4.1.5
*/
private $session;

/**
* @var array
*
Expand All @@ -58,10 +49,6 @@ final class JoomlaHttpDriver implements HttpDriverInterface
public function __construct(CMSApplicationInterface $app)
{
$this->app = $app;

if ($app instanceof SessionAwareWebApplicationInterface) {
$this->session = $app->getSession();
}
}

/**
Expand Down Expand Up @@ -89,7 +76,7 @@ public function setHeaders(array $headers)
*/
public function isSessionStarted()
{
return $this->session ? $this->session->isStarted() : true;
return true;
}

/**
Expand All @@ -102,11 +89,7 @@ public function isSessionStarted()
*/
public function setSessionValue($name, $value)
{
if ($this->session) {
$this->session->set($name, $value);
} else {
$this->dummySession[$name] = $value;
}
$this->dummySession[$name] = $value;
}

/**
Expand All @@ -120,7 +103,7 @@ public function setSessionValue($name, $value)
*/
public function hasSessionValue($name)
{
return $this->session ? $this->session->has($name) : array_key_exists($name, $this->dummySession);
return array_key_exists($name, $this->dummySession);
}

/**
Expand All @@ -134,10 +117,6 @@ public function hasSessionValue($name)
*/
public function getSessionValue($name)
{
if ($this->session) {
return $this->session->get($name);
}

return $this->dummySession[$name] ?? null;
}

Expand All @@ -150,10 +129,6 @@ public function getSessionValue($name)
*/
public function deleteSessionValue($name)
{
if ($this->session) {
$this->session->remove($name);
} else {
unset($this->dummySession[$name]);
}
unset($this->dummySession[$name]);
}
}