handle empty [file] to prevent logzilla

This commit is contained in:
Isaac Connor 2014-11-13 09:17:54 -05:00
parent 3eafed81df
commit ebe35c2135
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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 );