@@ -104,24 +104,26 @@ public function onRunJob() {
104104
105105 $ tmp = explode ("\n" , $ data );
106106 $ lastLog = array ();
107- if ($ tmp [sizeof ($ tmp ) - 1 ] == '' ) {
108- /* the log ends with an empty line remove this */
109- array_pop ($ tmp );
110- }
111- if (strpos ($ tmp [sizeof ($ tmp ) - 1 ], '------------- ' ) !== false ) {
112- /* the log ends with "-----..." remove this */
113- array_pop ($ tmp );
114- }
115- for ($ i = sizeof ($ tmp ) - 1 ; $ i > 0 ; $ i --) {
116- if (strpos ($ tmp [$ i ], '--------- ' ) === false ) {
117- /* no delimiter found, so add this to the last-log */
118- $ lastLog [] = $ tmp [$ i ];
119- } else {
120- /* delimiter found, so there is no more line left! */
121- break ;
107+ if (count ($ tmp ) >= 2 ) {
108+ if ($ tmp [sizeof ($ tmp ) - 1 ] == '' ) {
109+ /* the log ends with an empty line remove this */
110+ array_pop ($ tmp );
111+ }
112+ if (strpos ($ tmp [sizeof ($ tmp ) - 1 ], '------------- ' ) !== false ) {
113+ /* the log ends with "-----..." remove this */
114+ array_pop ($ tmp );
115+ }
116+ for ($ i = sizeof ($ tmp ) - 1 ; $ i > 0 ; $ i --) {
117+ if (strpos ($ tmp [$ i ], '--------- ' ) === false ) {
118+ /* no delimiter found, so add this to the last-log */
119+ $ lastLog [] = $ tmp [$ i ];
120+ } else {
121+ /* delimiter found, so there is no more line left! */
122+ break ;
123+ }
122124 }
123125 }
124-
126+
125127 /*
126128 * Now we have the last log in the array.
127129 * Check if the outdated-string is found...
0 commit comments