HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]

Source for file highlighter.php

Documentation is available at highlighter.php

  1. <style>
  2. .hl-main {font-family: monospace; font-size:13px;}
  3. .hl-gutter { background-color: #CCCCCC; padding-right: 10px;
  4.              font-family: monospace; font-size:13px;}
  5. .hl-table {border: solid 1px #000000; }
  6. .hl-default { color: #000000; }
  7. .hl-code { color: #7f7f33; }
  8. .hl-brackets { color: #009966; }
  9. .hl-comment { color: #7F7F7F; }
  10. .hl-quotes { color: #00007F; }
  11. .hl-string { color: #7F0000; }
  12. .hl-identifier { color: #000000; }
  13. .hl-reserved { color: #7F007F; }
  14. .hl-inlinedoc { color: #0000FF; }
  15. .hl-var { color: #0066FF; }
  16. .hl-url { color: #FF0000; }
  17. .hl-special { color: #0000FF; }
  18. .hl-number { color: #007F00; }
  19. .hl-inlinetags { color: #FF0000; }
  20. </style>
  21.  
  22. <?php
  23. $ok = false;
  24. if (isset($_GET['file'])) {
  25.     $file trim($_GET['file']);
  26.     if ((stristr($file'../'== false&&
  27.         (substr($file0,2== './'&& (file_exists($file))) {
  28.         $ok = true;
  29.     }
  30. }
  31.  
  32. if (!$ok{
  33.     die ("<b>this syntax is forbidden</b>");
  34.  
  35. else {
  36.     @include_once 'include_path.php';
  37.     include_once 'Text/Highlighter.php';
  38.  
  39.     $hl =Text_Highlighter::factory('PHP',array('numbers'=>HL_NUMBERS_TABLE));
  40.     $code file_get_contents($_GET['file']);
  41.     $html $hl->highlight($code);
  42.  
  43.     echo $html;
  44. }
  45. ?>

Documentation generated on Mon, 11 Mar 2019 15:24:46 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.