Filter error location in JSON and XML responses

This commit is contained in:
Kijin Sung 2020-03-19 17:56:38 +09:00
parent 1f9fe48170
commit 6a43274826
2 changed files with 23 additions and 0 deletions

View file

@ -56,6 +56,19 @@ class DisplayHandler extends Handler
{
$handler = new HTMLDisplayHandler();
}
// Handle error location info
if ($location = $oModule->get('rx_error_location'))
{
if (!Rhymix\Framework\Debug::isEnabledForCurrentUser())
{
$oModule->unset('rx_error_location');
}
elseif (starts_with(\RX_BASEDIR, $location))
{
$oModule->add('rx_error_location', $location = substr($location, strlen(\RX_BASEDIR)));
}
}
$output = $handler->toDoc($oModule);

View file

@ -280,6 +280,16 @@ class BaseObject
return $output;
}
/**
* Method to delete a key
*
* @return void
*/
function unset($key)
{
unset($this->variables[$key]);
}
/**
* Method to return either true or false depnding on the value in a 'error' variable
*