diff --git a/htdocs/application/config/geshi_languages.php b/htdocs/application/config/geshi_languages.php index c39c58d..f98b42d 100644 --- a/htdocs/application/config/geshi_languages.php +++ b/htdocs/application/config/geshi_languages.php @@ -39,7 +39,9 @@ $config['geshi_languages'] = array( 'apache' => 'Apache', 'applescript' => 'AppleScript', 'apt_sources' => 'Apt sources.list', + 'arm' => 'ARM Assembler', 'asm' => 'x86 Assembler', + 'asymptote' => 'asymptote', 'asp' => 'ASP', 'autoconf' => 'autoconf', 'autohotkey' => 'Autohotkey', @@ -69,6 +71,8 @@ $config['geshi_languages'] = array( 'cuesheet' => 'Cuesheet', 'd' => 'D', 'dcs' => 'DCS', + 'dcl' => 'DCL', + 'dcpu16' => 'DCPU/16 Assembly', 'delphi' => 'Delphi (Object Pascal)', 'div' => 'DIV', 'dos' => 'DOS', @@ -84,6 +88,7 @@ $config['geshi_languages'] = array( 'fo' => 'fo', 'fortran' => 'Fortran', 'freebasic' => 'FreeBasic', + 'freeswitch' => 'FreeSWITCH', 'fsharp' => 'F#', 'gambas' => 'GAMBAS', 'gdb' => 'GDB', @@ -96,6 +101,7 @@ $config['geshi_languages'] = array( 'groovy' => 'Groovy', 'gwbasic' => 'GwBasic', 'haskell' => 'Haskell', + 'haxe' => 'Haxe', 'hicest' => 'HicEst', 'hq9plus' => 'HQ9+', 'html4strict' => 'HTML 4.01 strict', @@ -114,6 +120,7 @@ $config['geshi_languages'] = array( 'klonec' => 'KLone with C', 'klonecpp' => 'KLone with C++', 'lb' => 'Liberty BASIC', + 'ldif' => 'LDIF', 'lisp' => 'Generic Lisp', 'llvm' => 'LLVM', 'locobasic' => 'Locomotive Basic (Amstrad CPC series)', @@ -135,17 +142,23 @@ $config['geshi_languages'] = array( 'mpasm' => 'Microchip Assembler', 'mxml' => 'MXML', 'mysql' => 'MySQL', + 'nagios' => 'Nagios', + 'netrexx' => 'NetRexx', 'newlisp' => 'newLISP', 'nsis' => 'Nullsoft Scriptable Install System', 'oberon2' => 'Oberon-2', 'objc' => 'Objective-C', 'objeck' => 'Objeck Programming Language', 'ocaml' => 'OCaml (Objective Caml)', + 'octave' => 'GNU Octave M-file', 'oobas' => 'OpenOffice.org Basic', + 'oorexx' => 'ooRexx', 'oracle11' => 'Oracle 11i', 'oracle8' => 'Oracle 8', 'oxygene' => 'Delphi Prism (Oxygene)', 'oz' => 'Oz', + 'parasail' => 'ParaSail', + 'parigp' => 'PARI/GP', 'pascal' => 'Pascal', 'pcre' => 'PCRE', 'per' => 'Per (forms)', @@ -167,11 +180,13 @@ $config['geshi_languages'] = array( 'properties' => 'Property', 'providex' => 'ProvideX', 'purebasic' => 'PureBasic', + 'pys60' => 'Python for S60', 'q' => 'q/kdb+', 'qbasic' => 'QBasic/QuickBASIC', 'rails' => 'Ruby (with Ruby on Rails Framework)', 'rebol' => 'Rebol', 'reg' => 'Microsoft Registry Editor', + 'rexx' => 'Rexx', 'robots' => 'robots.txt', 'rpmspec' => 'RPM Spec', 'rsplus' => 'R', @@ -182,6 +197,9 @@ $config['geshi_languages'] = array( 'sdlbasic' => 'sdlBasic', 'smalltalk' => 'Smalltalk', 'smarty' => 'Smarty template', + 'spark' => 'SPARK', + 'sparql' => 'SPARQL', + 'stonescript' => 'StoneScript', 'systemverilog' => 'SystemVerilog IEEE 1800-2009(draft8)', 'tcl' => 'TCL/iTCL', 'teraterm' => 'Tera Term Macro', @@ -190,9 +208,12 @@ $config['geshi_languages'] = array( 'typoscript' => 'TypoScript', 'unicon' => 'Unicon', 'uscript' => 'UnrealScript', + 'upc' => 'UPC', + 'urbi' => 'Urbi', 'vala' => 'Vala', 'vb' => 'Visual Basic', 'vbnet' => 'VB.NET', + 'vedit' => 'Vedit macro language', 'verilog' => 'Verilog', 'vhdl' => 'VHDL', 'vim' => 'Vim scripting', diff --git a/htdocs/application/libraries/geshi/contrib/aliased.php b/htdocs/application/libraries/geshi/contrib/aliased.php index e57b495..cee3128 100644 --- a/htdocs/application/libraries/geshi/contrib/aliased.php +++ b/htdocs/application/libraries/geshi/contrib/aliased.php @@ -13,7 +13,7 @@ * aliased.php/file.name.ext. * * @author Ross Golder - * @version $Id: aliased.php 881 2007-01-10 11:14:38Z oracleshinoda $ + * @version $Id: aliased.php 2533 2012-08-15 18:49:04Z benbe $ */ // Your config here @@ -29,19 +29,18 @@ $path = SOURCE_ROOT.$_SERVER['PATH_INFO']; $base_path_len = strlen(SOURCE_ROOT); $real_path = realpath($path); if(strncmp($real_path, SOURCE_ROOT, $base_path_len)) { - exit("Stop that."); + exit("Access outside acceptable path."); } // Check file exists if(!file_exists($path)) { - exit("File not found ($path)."); + exit("File not found ($path)."); } -// Gather contents -$contents = file_get_contents($path); - // Prepare GeSHi instance -$geshi =& new GeSHi($contents, "PHP"); +$geshi = new GeSHi(); +$geshi->set_language('text'); +$geshi->load_from_file($path); $geshi->set_header_type(GESHI_HEADER_PRE); $geshi->enable_classes(); $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10); @@ -50,7 +49,7 @@ $geshi->set_line_style('font: normal normal 95% \'Courier New\', Courier, monosp $geshi->set_code_style('color: #000020;', 'color: #000020;'); $geshi->set_link_styles(GESHI_LINK, 'color: #000060;'); $geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;'); -$geshi->set_header_content('Source code viewer'); +$geshi->set_header_content('Source code viewer - ' . $path . ' - ' . $geshi->get_language_name()); $geshi->set_header_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;'); $geshi->set_footer_content('Parsed in