Changeset 15189
- Timestamp:
- 03/30/13 12:20:49 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/showlog.php
r15112 r15189 61 61 } 62 62 63 /* 63 64 function ascii2entities($string) 64 65 { … … 72 73 return $string; 73 74 } 75 */ 74 76 75 77 function ansi_decode($matches) … … 253 255 // font-weight property. 254 256 if ($styles['bold'] && is_null($styles['color'])) 255 $css .= ($css ? ';' : '') . 'font-weight: 257 $css .= ($css ? ';' : '') . 'font-weight:bold'; 256 258 257 259 // color property. … … 274 276 // Replace database strings 275 277 $str = preg_replace("/\ (([[:word:].-]+)(:[^ ]+)?(@))?([[:word:].-]+)(:([[:digit:]]+))?(\/([[:word:].-]+))/", " $2$4$5$8", $str); 278 276 279 // Replace special characters to their corresponding HTML entities 277 $str = ascii2entities($str); 280 //$str = ascii2entities($str); 281 $str = htmlentities($str, ENT_NOQUOTES); 282 278 283 // Replace ANSI codes. 279 284 $str = preg_replace_callback('/(?:\e\[\d+(?:;\d+)*m)+/', 'ansi_decode', "$str\033[0m"); 285 280 286 // Strip ASCII bell. 281 $str = str_replace("\007", '', $str); 287 // $str = str_replace("\007", '', $str); 288 282 289 // Replace \n 283 290 // $str = str_replace("\n", "<br/>\n", $str); 291 284 292 // Return the parsed string. 285 293 return $str; … … 338 346 print("<meta http-equiv='refresh' content='".$refresh."'>\n"); 339 347 ?> 348 <meta charset="UTF-8"> 340 349 <title><?php print($dir." - ".$name);?></title> 341 </head>342 343 350 <script> 344 351 function scroll(top) … … 347 354 } 348 355 </script> 356 </head> 349 357 <body onload="setTimeout(function(){scroll(false);},1);"> 350 358 <span onclick="scroll(true);" style="cursor:pointer;padding:0 5px 4px 7px;position:fixed;top:0;right:0;text-decoration:underline;color:navy;background-color:#f0f0f0;">go to top ↑</span> … … 355 363 <?php 356 364 foreach ($file as $line) 357 print(ansi2html( $line));365 print(ansi2html(substr($line, 0, -1))."\n"); 358 366 ?> 359 </pre><span id="bottom""/></body> 367 368 </pre> 369 <span id="bottom"></span> 370 </body> 360 371 </html>
Note:
See TracChangeset
for help on using the changeset viewer.