Ajax/Debug

* be a lot more verbose when errors are occuring (to staff anyway)
 * made hardcoded error messages for comments localizable
 * add error messages from posting comments to session to be displayed on next page update
This commit is contained in:
Sarjuuk
2018-05-26 20:20:15 +02:00
parent 93a72013b8
commit adc1273b08
21 changed files with 290 additions and 57 deletions

View File

@@ -36,9 +36,11 @@ class AjaxData extends AjaxHandler
foreach ($this->params as $set)
{
// requires valid token to hinder automated access
if ($set != 'item-scaling')
if (!$this->_get['t'] || empty($_SESSION['dataKey']) || $this->_get['t'] != $_SESSION['dataKey'])
continue;
if ($set != 'item-scaling' && (!$this->_get['t'] || empty($_SESSION['dataKey']) || $this->_get['t'] != $_SESSION['dataKey']))
{
trigger_error('AjaxData::handleData - session data key empty or expired', E_USER_ERROR);
continue;
}
switch ($set)
{
@@ -107,6 +109,7 @@ class AjaxData extends AjaxHandler
$result .= "\n\n";
break;
default:
trigger_error('AjaxData::handleData - invalid file "'.$set.'" in request', E_USER_ERROR);
break;
}
}