diff --git a/web/ajax/log.php b/web/ajax/log.php index e5096b03d..4fb1ebed7 100644 --- a/web/ajax/log.php +++ b/web/ajax/log.php @@ -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 diff --git a/web/js/logger.js b/web/js/logger.js index e7f98c301..1f4eb6752 100644 --- a/web/js/logger.js +++ b/web/js/logger.js @@ -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 );