@@ -41,11 +41,13 @@ public function __construct(
4141 $ this ->index = $ index ;
4242 $ this ->fileIdentifier = $ fileIdentifier ;
4343 $ this ->filePosition = $ filePosition ;
44- $ text = mb_convert_encoding (rtrim ($ text , "\t\n\r" ), 'UTF-8 ' , 'UTF-8 ' );
44+ $ this -> fullText = mb_convert_encoding (rtrim ($ text , "\t\n\r" ), 'UTF-8 ' , 'UTF-8 ' );
4545 $ this ->fullTextLength = strlen ($ text );
4646
47+ $ this ->extractContextsFromFullText ();
48+
4749 $ matches = [];
48- [$ firstLine , $ theRestOfIt ] = explode ("\n" , Str::finish ($ text , "\n" ), 2 );
50+ [$ firstLine , $ theRestOfIt ] = explode ("\n" , Str::finish ($ this -> fullText , "\n" ), 2 );
4951
5052 // sometimes, even the first line will have a HUGE exception with tons of debug data all in one line,
5153 // so in order to properly match, we must have a smaller first line...
@@ -74,12 +76,12 @@ public function __construct(
7476 }
7577
7678 $ this ->text = trim ($ firstLineText );
77- $ text = $ firstLineText .($ matches [8 ] ?? '' ).implode ('' , $ firstLineSplit )."\n" .$ theRestOfIt ;
79+ $ this -> fullText = $ firstLineText .($ matches [8 ] ?? '' ).implode ('' , $ firstLineSplit )."\n" .$ theRestOfIt ;
7880
7981 if (session ()->get ('log-viewer:shorter-stack-traces ' , false )) {
8082 $ excludes = config ('log-viewer.shorter_stack_trace_excludes ' , []);
8183 $ emptyLineCharacter = ' ... ' ;
82- $ lines = explode ("\n" , $ text );
84+ $ lines = explode ("\n" , $ this -> fullText );
8385 $ filteredLines = [];
8486 foreach ($ lines as $ line ) {
8587 $ shouldExclude = false ;
@@ -96,17 +98,15 @@ public function __construct(
9698 $ filteredLines [] = $ line ;
9799 }
98100 }
99- $ text = implode ("\n" , $ filteredLines );
101+ $ this -> fullText = implode ("\n" , $ filteredLines );
100102 }
101103
102- if (strlen ($ text ) > LogViewer::maxLogSize ()) {
103- $ text = Str::limit ($ text , LogViewer::maxLogSize ());
104+ if (strlen ($ this -> fullText ) > LogViewer::maxLogSize ()) {
105+ $ this -> fullText = Str::limit ($ this -> fullText , LogViewer::maxLogSize ());
104106 $ this ->fullTextIncomplete = true ;
105107 }
106108
107- $ this ->fullText = trim ($ text );
108-
109- $ this ->extractContextsFromFullText ();
109+ $ this ->fullText = trim ($ this ->fullText );
110110 }
111111
112112 public function fullTextMatches (string $ query = null ): bool
0 commit comments