Fixed error reporting (current web page url, JS file name sanitization)
- Added tests on master branch - Added support for js/*.js files - Added support for slashes and dots in file paths - Added back support for 'url' (the current webpage) All js files where reported as 'index.php' now they are reported as their real name Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
a4714b168d
commit
07389d12aa
@ -224,7 +224,7 @@ var ErrorReport = {
|
||||
'server': PMA_commonParams.get('server'),
|
||||
'ajax_request': true,
|
||||
'exception': exception,
|
||||
'current_url': window.location.href,
|
||||
'url': window.location.href,
|
||||
'exception_type': 'js'
|
||||
};
|
||||
if (AJAX.scriptHandler._scripts.length > 0) {
|
||||
|
||||
@ -99,6 +99,11 @@ class ErrorReport
|
||||
$exception["uri"] = $uri;
|
||||
$report["script_name"] = $scriptName;
|
||||
unset($exception["url"]);
|
||||
} else if (isset($_POST["url"])) {
|
||||
list($uri, $scriptName) = $this->sanitizeUrl($_POST["url"]);
|
||||
$exception["uri"] = $uri;
|
||||
$report["script_name"] = $scriptName;
|
||||
unset($_POST["url"]);
|
||||
} else {
|
||||
$report["script_name"] = null;
|
||||
}
|
||||
@ -175,7 +180,7 @@ class ErrorReport
|
||||
}
|
||||
|
||||
// get script name
|
||||
preg_match("<([a-zA-Z\-_\d]*\.php)$>", $components["path"], $matches);
|
||||
preg_match("<([a-zA-Z\-_\d\.]*\.php|js\/[a-zA-Z\-_\d\/\.]*\.js)$>", $components["path"], $matches);
|
||||
if (count($matches) < 2) {
|
||||
$scriptName = 'index.php';
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user