handle empty [file] to prevent logzilla
This commit is contained in:
parent
3eafed81df
commit
ebe35c2135
|
@ -10,7 +10,8 @@ switch ( $_REQUEST['task'] )
|
|||
logInit( array( 'id' => "web_js" ) );
|
||||
|
||||
$string = $_POST['message'];
|
||||
$file = preg_replace( '/\w+:\/\/\w+\//', '', $_POST['file'] );
|
||||
|
||||
$file = !empty($_POST['file']) ? preg_replace( '/\w+:\/\/\w+\//', '', $_POST['file'] ) : '';
|
||||
if ( !empty( $_POST['line'] ) )
|
||||
$line = $_POST['line'];
|
||||
else
|
||||
|
|
|
@ -57,8 +57,10 @@ function logReport( level, message, file, line )
|
|||
requestParms += "&level="+level+"&message="+encodeURIComponent(message);
|
||||
if ( file )
|
||||
requestParms += "&file="+file;
|
||||
else
|
||||
else if ( location.search ) {
|
||||
//location.search is the querystring part, so ?blah=blah but there is almost never any value to this
|
||||
requestParms += "&file="+location.search;
|
||||
}
|
||||
if ( line )
|
||||
requestParms += "&line="+line;
|
||||
debugReq.send( requestParms );
|
||||
|
|
Loading…
Reference in New Issue