@@ -66,9 +66,6 @@ class main
6666 /** @var \phpbb\captcha\factory */
6767 protected $ captcha_factory ;
6868
69- /** @var string */
70- protected $ geshi_lang ;
71-
7269 /** @var string */
7370 protected $ pastebin_table ;
7471
@@ -105,7 +102,6 @@ public function __construct(
105102 \phpbbde \pastebin \functions \pastebin $ pastebin ,
106103 $ root_path ,
107104 $ php_ext ,
108- $ geshi_lang ,
109105 $ pastebin_table )
110106 {
111107 $ this ->auth = $ auth ;
@@ -125,7 +121,6 @@ public function __construct(
125121 $ this ->captcha_factory = $ captcha_factory ;
126122
127123 $ this ->pastebin_table = $ pastebin_table ;
128- $ this ->geshi_lang = $ geshi_lang ;
129124 }
130125
131126 public function handle ()
@@ -294,10 +289,10 @@ private function display_pb()
294289 $ error [] = $ this ->language ->lang ('PASTEBIN_ERR_NO_TITLE ' );
295290 }
296291
297- if (!$ this ->util ->geshi_check ($ data ['snippet_highlight ' ]))
292+ /* if (!$this->util->geshi_check($data['snippet_highlight']))
298293 {
299294 $data['snippet_highlight'] = 'text';
300- }
295+ }*/
301296
302297 $ filedata = $ this ->request ->file ('fileupload ' );
303298
@@ -415,21 +410,15 @@ private function display_pb()
415410
416411 $ highlight = ($ this ->request ->is_set ('highlight ' )) ? $ this ->request ->variable ('highlight ' , '' ) : $ data ['snippet_highlight ' ];
417412
418- if (!$ this ->util ->geshi_check ($ highlight ))
419- {
420- $ highlight = 'php ' ;
421- }
422-
423413 $ code = $ snippet_text ;
424414
425- $ geshi = new \GeSHi ($ code , $ highlight , $ this ->util ->geshi_dir );
426- $ geshi ->set_header_type (GESHI_HEADER_NONE );
427- $ geshi ->enable_line_numbers (GESHI_NORMAL_LINE_NUMBERS , 100 );
428-
429- $ code = $ geshi ->parse_code ();
415+ $ highlighter = new \Tempest \Highlight \Highlighter ();
416+ // TODO: Add option to change language used at this point html,css etc.
417+ $ code = $ highlighter ->parse ($ code , 'php ' );
430418
431419 $ snippet_text_display = &$ code ;
432420
421+
433422 $ s_hidden_fields = array_merge ($ s_hidden_fields , array (
434423 's ' => $ snippet_id ,
435424 ));
0 commit comments