Rev 9 | Rev 12 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | <?php |
2 | |||
9 | daniel-mar | 3 | $xxx_vts_prepend_config = array(); |
10 | daniel-mar | 4 | if (file_exists($xxx_vts_prepend_config_file = __DIR__.'/../config.local.php')) include $xxx_vts_prepend_config_file; |
9 | daniel-mar | 5 | unset($xxx_vts_prepend_config_file); |
6 | $xxx_directories_need_ereg = $xxx_vts_prepend_config['directories_need_ereg'] ?? array(); |
||
7 | unset($xxx_vts_prepend_config); |
||
2 | daniel-mar | 8 | |
9 | $xxx_go = false; |
||
10 | foreach ($xxx_directories_need_ereg as $xxx_directory_need_ereg) { |
||
9 | daniel-mar | 11 | if ($xxx_negate = (substr($xxx_directory_need_ereg,0,1) === '!')) { |
12 | $xxx_directory_need_ereg = substr($xxx_directory_need_ereg,1); |
||
13 | } |
||
2 | daniel-mar | 14 | if (strpos($_SERVER['SCRIPT_FILENAME'], $xxx_directory_need_ereg) === 0) { |
9 | daniel-mar | 15 | $xxx_go = !$xxx_negate; |
2 | daniel-mar | 16 | } |
9 | daniel-mar | 17 | unset($xxx_negate); |
2 | daniel-mar | 18 | } |
19 | unset($xxx_directories_need_ereg); |
||
20 | unset($xxx_directory_need_ereg); |
||
9 | daniel-mar | 21 | |
2 | daniel-mar | 22 | if ($xxx_go) { |
23 | if (function_exists('ereg') !== true) { |
||
24 | function ereg($pattern, $string, &$regs) { |
||
25 | return preg_match('~' . addcslashes($pattern, '~') . '~', $string, $regs); |
||
26 | } |
||
27 | } |
||
28 | |||
29 | if (function_exists('eregi') !== true) { |
||
30 | function eregi($pattern, $string, &$regs) { |
||
31 | return preg_match('~' . addcslashes($pattern, '~') . '~i', $string, $regs); |
||
32 | } |
||
33 | } |
||
34 | |||
35 | if (function_exists('ereg_replace') !== true) { |
||
36 | function ereg_replace($pattern, $string, $replace) { |
||
37 | return preg_replace('~' . addcslashes($pattern, '~') . '~', $string, $replace); |
||
38 | } |
||
39 | } |
||
40 | |||
41 | if (function_exists('eregi_replace') !== true) { |
||
42 | function eregi_replace($pattern, $string, $replace) { |
||
43 | return preg_replace('~' . addcslashes($pattern, '~') . '~i', $string, $replace); |
||
44 | } |
||
45 | } |
||
46 | |||
47 | if (function_exists('split') !== true) { |
||
48 | function split($pattern, $string, $limit=-1) { |
||
49 | return preg_split('~' . addcslashes($pattern, '~') . '~', $string, $limit); |
||
50 | } |
||
51 | } |
||
52 | |||
53 | if (function_exists('spliti') !== true) { |
||
54 | function spliti($pattern, $string, $limit=-1) { |
||
55 | return preg_split('~' . addcslashes($pattern, '~') . '~i', $string, $limit); |
||
56 | } |
||
57 | } |
||
58 | |||
59 | if (function_exists('sql_regcase') !== true) { |
||
60 | function sql_regcase($string) { |
||
61 | $out = ''; |
||
62 | for ($i=0; $i<strlen($string); $i++) { |
||
63 | $char = $string[$i]; |
||
64 | $up = strtoupper($char); |
||
65 | $low = strtolower($char); |
||
66 | if ($up != $low) { |
||
7 | daniel-mar | 67 | $out .= "[$up$low]"; |
2 | daniel-mar | 68 | } else { |
69 | $out .= $char; |
||
70 | } |
||
71 | } |
||
72 | return $out; |
||
73 | } |
||
74 | } |
||
75 | } |
||
76 | unset($xxx_go); |