mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Delete JsError action
This commit is contained in:
parent
66b23747c7
commit
1b2306c7b0
4 changed files with 1 additions and 106 deletions
|
|
@ -55,33 +55,6 @@ class AbstractApp extends AbstractBoot {
|
|||
|
||||
this.iframe = $('<iframe class="internal-hiddden" />').appendTo('body');
|
||||
|
||||
$win.on('error', (event) => {
|
||||
if (
|
||||
event &&
|
||||
event.originalEvent &&
|
||||
event.originalEvent.message &&
|
||||
-1 ===
|
||||
inArray(event.originalEvent.message, ['Script error.', 'Uncaught Error: Error calling method on NPObject.'])
|
||||
) {
|
||||
const time = timestamp();
|
||||
if (this.lastErrorTime >= time) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.lastErrorTime = time;
|
||||
|
||||
Remote.jsError(
|
||||
noop,
|
||||
event.originalEvent.message,
|
||||
event.originalEvent.filename,
|
||||
event.originalEvent.lineno,
|
||||
window.location && window.location.toString ? window.location.toString() : '',
|
||||
$html.attr('class'),
|
||||
microtime() - startMicrotime
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
$win.on('resize', () => {
|
||||
Events.pub('window.resize');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -221,40 +221,6 @@ class AbstractAjaxRemote {
|
|||
this.defaultRequest(fCallback, 'Noop');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
* @param {string} sMessage
|
||||
* @param {string} sFileName
|
||||
* @param {number} iLineNo
|
||||
* @param {string} sLocation
|
||||
* @param {string} sHtmlCapa
|
||||
* @param {number} iTime
|
||||
*/
|
||||
jsError(fCallback, sMessage, sFileName, iLineNo, sLocation, sHtmlCapa, iTime) {
|
||||
this.defaultRequest(fCallback, 'JsError', {
|
||||
'Message': sMessage,
|
||||
'FileName': sFileName,
|
||||
'LineNo': iLineNo,
|
||||
'Location': sLocation,
|
||||
'HtmlCapa': sHtmlCapa,
|
||||
'TimeOnPage': iTime
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
* @param {string} sType
|
||||
* @param {Array=} mData = null
|
||||
* @param {boolean=} bIsError = false
|
||||
*/
|
||||
jsInfo(fCallback, sType, mData, bIsError = false) {
|
||||
this.defaultRequest(fCallback, 'JsInfo', {
|
||||
'Type': sType,
|
||||
'Data': mData,
|
||||
'IsError': bIsError ? '1' : '0'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5081,20 +5081,6 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
|
|||
return $this->DefaultResponse(__FUNCTION__, $mResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function DoJsInfo()
|
||||
{
|
||||
$bIsError = '1' === (string) $this->GetActionParam('IsError', '0');
|
||||
$mData = $this->GetActionParam('Data', null);
|
||||
|
||||
$this->Logger()->WriteDump(is_array($mData) ? $mData : array(),
|
||||
$bIsError ? \MailSo\Log\Enumerations\Type::ERROR : \MailSo\Log\Enumerations\Type::INFO, 'JS-INFO');
|
||||
|
||||
return $this->DefaultResponse(__FUNCTION__, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
|
@ -5123,36 +5109,6 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
|
|||
APP_VERSION === (string) $this->GetActionParam('Version', ''));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function DoJsError()
|
||||
{
|
||||
$sMessage = $this->GetActionParam('Message', '');
|
||||
if (0 < strlen($sMessage))
|
||||
{
|
||||
$sFileName = $this->GetActionParam('FileName', '');
|
||||
$sLineNo = $this->GetActionParam('LineNo', '');
|
||||
$sLocation = $this->GetActionParam('Location', '');
|
||||
$sHtmlCapa = $this->GetActionParam('HtmlCapa', '');
|
||||
$sTimeOnPage = $this->GetActionParam('TimeOnPage', '');
|
||||
|
||||
$oHttp = $this->Http();
|
||||
|
||||
$this->Logger()->Write($sMessage.' ('.$sFileName.' ~ '.$sLineNo.')', \MailSo\Log\Enumerations\Type::ERROR, 'JS');
|
||||
$this->Logger()->WriteDump(array(
|
||||
'Location' => $sLocation,
|
||||
'Capability' => $sHtmlCapa,
|
||||
'TimeOnPage' => $sTimeOnPage,
|
||||
'HTTP_USER_AGENT' => $oHttp->GetServer('HTTP_USER_AGENT', ''),
|
||||
'HTTP_ACCEPT_ENCODING' => $oHttp->GetServer('HTTP_ACCEPT_ENCODING', ''),
|
||||
'HTTP_ACCEPT_LANGUAGE' => $oHttp->GetServer('HTTP_ACCEPT_LANGUAGE', '')
|
||||
));
|
||||
}
|
||||
|
||||
return $this->DefaultResponse(__FUNCTION__, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \MailSo\Mail\FolderCollection $oFolders
|
||||
* @return array
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class ServiceActions
|
|||
|
||||
try
|
||||
{
|
||||
if ($this->oHttp->IsPost() && !in_array($sAction, array('JsInfo', 'JsError')) &&
|
||||
if ($this->oHttp->IsPost() &&
|
||||
$this->Config()->Get('security', 'csrf_protection', false) &&
|
||||
$this->oHttp->GetPost('XToken', '') !== \RainLoop\Utils::GetCsrfToken())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue