File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ services:
99 class : phpbbde\pastebin\functions\utility
1010 arguments :
1111 - ' %phpbbde.pastebin.geshilangs%'
12+ - ' %core.php_ext%'
1213 phpbbde.pastebin.functions.pastebin :
1314 class : phpbbde\pastebin\functions\pastebin
1415 arguments :
Original file line number Diff line number Diff line change @@ -31,13 +31,18 @@ class utility
3131 */
3232 var $ geshi_list = array ();
3333
34+ /** @var string */
35+ protected $ php_ext ;
36+
3437 /**
3538 * Constructor
39+ * @param string $php_ext
3640 */
37- function __construct ($ geshi_dir )
41+ function __construct ($ geshi_dir, $ php_ext )
3842 {
3943 $ this ->geshi_dir = $ geshi_dir ;
4044 $ this ->geshi_list = $ this ->geshi_list ();
45+ $ this ->php_ext = $ php_ext ;
4146 }
4247
4348
@@ -54,8 +59,6 @@ function geshi_check($needle)
5459 */
5560 function geshi_list ()
5661 {
57- global $ phpEx ;
58-
5962 $ geshi_list = array ();
6063
6164 $ d = dir ($ this ->geshi_dir );
@@ -66,13 +69,15 @@ function geshi_list()
6669 continue ;
6770 }
6871
69- if (($ substr_end = strpos ($ file , ". $ phpEx " )) !== false )
72+ if (($ substr_end = strpos ($ file , ". $ this -> php_ext " )) !== false )
7073 {
71- @ sort ( $ geshi_list [] = substr ($ file , 0 , $ substr_end) );
74+ $ geshi_list [] = substr ($ file , 0 , $ substr_end );
7275 }
7376 }
7477 $ d ->close ();
7578
79+ sort ($ geshi_list );
80+
7681 return $ geshi_list ;
7782 }
7883
You can’t perform that action at this time.
0 commit comments