117{
118 if ( isset(
$_GET[$var_name]) )
119 {
120 return str_replace(
"\'",
"'",
$_GET[$var_name]);
121 }
122 elseif ( isset(
$_POST[$var_name]) )
123 {
124 return str_replace(
"\'",
"'",
$_POST[$var_name]);
125 }
126 return null;
127}
128
129
130
131
132
133
134foreach ( $_REQUEST as $var )
135{
136 unset($$var);
137}
138foreach ( array(
139 '_POST' => 'HTTP_POST_VARS',
140 '_GET' => 'HTTP_GET_VARS',
141 '_COOKIE' => 'HTTP_COOKIE_VARS',
142 '_SERVER' => 'HTTP_SERVER_VARS',
143 '_ENV' => 'HTTP_ENV_VARS',
144 '_FILES' => 'HTTP_POST_FILES') as $array => $other )
145{
146 if ( !isset($$array) )
147 {
148 $$array = $$other;
149 }
150 unset($$other);
151}
152
153
154
156
158{
161 echo "Welcome to the GeSHi CSS generator.<br /><pre>Searching for GeSHi... ";
162
163
164 $geshi_path =
get_var(
'geshi-path');
165 $geshi_lang_path =
get_var(
'geshi-lang-path');
166
167 if(strstr($geshi_path, '..')) {
168 unset($geshi_path);
169 }
170 if(strstr($geshi_lang_path, '..')) {
171 unset($geshi_lang_path);
172 }
173
174 if ( !$geshi_path )
175 {
176 $geshi_path = '../geshi.php';
177 }
178 if ( !$geshi_lang_path )
179 {
180 $geshi_lang_path = '../geshi/';
181 }
182
183 if ( is_file($geshi_path) && is_readable($geshi_path) )
184 {
185
186 $file = @file($geshi_path);
187 $contents = '';
188 foreach ( $file as $line )
189 {
190 $contents .= $line;
191 }
192 if ( strpos($contents, '<?php";
378
379 if ( $overall != '' )
380 {
381 $stylesheet .= "\n$overall_selector {{$overall_styles}}";
382 }
383 if ( $default_styles != '' )
384 {
385 $default_selector = str_replace(array('{PART1}', '{PART2}'), array('.de1', '.de2'), $part_selector_2);
386 $stylesheet .= "\n$default_selector {{$default_styles}}";
387 }
388
389 // Do keywords
390 $keywords_1 = get_var('keywords-1');
391 $keyword_selector_1 = str_replace('{PART}', '.kw1', $part_selector_1);
392 if ( $keywords_1 != '' )
393 {
394 $stylesheet .= "\n$keyword_selector_1 {{$keywords_1}}";
395 }
396
397 $keywords_2 = get_var('keywords-2');
398 $keyword_selector_2 = str_replace('{PART}', '.kw2', $part_selector_1);
399 if ( $keywords_2 != '' )
400 {
401 $stylesheet .= "\n$keyword_selector_2 {{$keywords_2}}";
402 }
403
404 $keywords_3 = get_var('keywords-3');
405 $keyword_selector_3 = str_replace('{PART}', '.kw3', $part_selector_1);
406 if ( $keywords_3 != '' )
407 {
408 $stylesheet .= "\n$keyword_selector_3 {{$keywords_3}}";
409 }
410
411 $keywords_4 = get_var('keywords-4');
412 $keyword_selector_4 = str_replace('{PART}', '.kw4', $part_selector_1);
413 if ( $keywords_4 != '' )
414 {
415 $stylesheet .= "\n$keyword_selector_4 {{$keywords_4}}";
416 }
417
418 // Do other lexics
419 $comments = get_var('comments');
420 $comment_selector = str_replace(array('{PART1}', '{PART2}', '{PART3}'), array('.co1', '.co2', '.coMULTI'), $part_selector_3);
421 if ( $comments != '' )
422 {
423 $stylesheet .= "\n$comment_selector {{$comments}}";
424 }
425
426 $esc = get_var('escaped-chars');
427 $esc_selector = str_replace('{PART}', '.es0', $part_selector_1);
428 if ( $esc != '' )
429 {
430 $stylesheet .= "\n$esc_selector {{$esc}}";
431 }
432
433 $brackets = get_var('brackets');
434 $brk_selector = str_replace('{PART}', '.br0', $part_selector_1);
435 if ( $brackets != '' )
436 {
437 $stylesheet .= "\n$brk_selector {{$brackets}}";
438 }
439
440 $strings = get_var('strings');
441 $string_selector = str_replace('{PART}', '.st0', $part_selector_1);
442 if ( $strings != '' )
443 {
444 $stylesheet .= "\n$string_selector {{$strings}}";
445 }
446
447 $numbers = get_var('numbers');
448 $num_selector = str_replace('{PART}', '.nu0', $part_selector_1);
449 if ( $numbers != '' )
450 {
451 $stylesheet .= "\n$num_selector {{$numbers}}";
452 }
453
454 $methods = get_var('methods');
455 $method_selector = str_replace('{PART}', '.me0', $part_selector_1);
456 if ( $methods != '' )
457 {
458 $stylesheet .= "\n$method_selector {{$methods}}";
459 }
460
461 echo "<pre>$stylesheet</pre>";
462
463 make_footer();
464}
foreach($_REQUEST as $var) foreach(array('_POST'=> 'HTTP_POST_VARS', '_GET'=> 'HTTP_GET_VARS', '_COOKIE'=> 'HTTP_COOKIE_VARS', '_SERVER'=> 'HTTP_SERVER_VARS', '_ENV'=> 'HTTP_ENV_VARS', '_FILES'=> 'HTTP_POST_FILES') as $array=> $other) $step