33set_magic_quotes_runtime(0);
40 echo
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
41<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
43 <title>GeSHi CSS Generator :: ' .
$title .
' </title>
44 <style type="text/css" media="screen">
47 font-family: Verdana, Arial, sans-serif;
49 background-color: #d0d0d0;
54 border: 1px solid #f0f0f0;
55 background-color: #f6f6f6;
58 border-bottom: 2px solid #e0e0e0;
64 border: 1px solid #d0d0d0;
79 border-top: 1px solid #e0e0e0;
86 <script type="text/javascript">
87 function select (state)
89 var cboxes = document.getElementsByTagName(\'input\');
90 for (var i = 0; i < cboxes.length; i++) {
91 if (cboxes[i].type == "checkbox") {
92 if (state == "true") {
93 cboxes[i].checked = true;
94 } elseif (state == "false") {
95 cboxes[i].checked = false;
96 } elseif (state == "invert") {
97 cboxes[i].checked = !cboxes[i].checked;
111 echo
'<div id="footer"><a href="http://qbnz.com/highlighter/">GeSHi</a> © Nigel McNie, 2004, released under the GPL</div></body>
118 if ( isset(
$_GET[$var_name]) )
120 return str_replace(
"\'",
"'",
$_GET[$var_name]);
122 elseif ( isset(
$_POST[$var_name]) )
124 return str_replace(
"\'",
"'",
$_POST[$var_name]);
134foreach ( $_REQUEST as $var )
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 )
146 if ( !isset($$array) )
161 echo
"Welcome to the GeSHi CSS generator.<br /><pre>Searching for GeSHi... ";
164 $geshi_path =
get_var(
'geshi-path');
165 $geshi_lang_path =
get_var(
'geshi-lang-path');
167 if(strstr($geshi_path,
'..')) {
170 if(strstr($geshi_lang_path,
'..')) {
171 unset($geshi_lang_path);
176 $geshi_path =
'../geshi.php';
178 if ( !$geshi_lang_path )
180 $geshi_lang_path =
'../geshi/';
183 if ( is_file($geshi_path) && is_readable($geshi_path) )
186 $file = @file($geshi_path);
188 foreach (
$file as $line )
379 if ( $overall != '' )
381 $stylesheet .= "\n$overall_selector {{$overall_styles}}";
383 if ( $default_styles != '' )
385 $default_selector = str_replace(array('{PART1}
', '{PART2}
'), array('.de1
', '.de2
'), $part_selector_2);
386 $stylesheet .= "\n$default_selector {{$default_styles}}";
390 $keywords_1 = get_var('keywords-1
');
391 $keyword_selector_1 = str_replace('{PART}
', '.kw1
', $part_selector_1);
392 if ( $keywords_1 != '' )
394 $stylesheet .= "\n$keyword_selector_1 {{$keywords_1}}";
397 $keywords_2 = get_var('keywords-2
');
398 $keyword_selector_2 = str_replace('{PART}
', '.kw2
', $part_selector_1);
399 if ( $keywords_2 != '' )
401 $stylesheet .= "\n$keyword_selector_2 {{$keywords_2}}";
404 $keywords_3 = get_var('keywords-3
');
405 $keyword_selector_3 = str_replace('{PART}
', '.kw3
', $part_selector_1);
406 if ( $keywords_3 != '' )
408 $stylesheet .= "\n$keyword_selector_3 {{$keywords_3}}";
411 $keywords_4 = get_var('keywords-4
');
412 $keyword_selector_4 = str_replace('{PART}
', '.kw4
', $part_selector_1);
413 if ( $keywords_4 != '' )
415 $stylesheet .= "\n$keyword_selector_4 {{$keywords_4}}";
419 $comments = get_var('comments
');
420 $comment_selector = str_replace(array('{PART1}
', '{PART2}
', '{PART3}
'), array('.co1
', '.co2
', '.coMULTI
'), $part_selector_3);
421 if ( $comments != '' )
423 $stylesheet .= "\n$comment_selector {{$comments}}";
426 $esc = get_var('escaped-chars
');
427 $esc_selector = str_replace('{PART}
', '.es0
', $part_selector_1);
430 $stylesheet .= "\n$esc_selector {{$esc}}";
433 $brackets = get_var('brackets
');
434 $brk_selector = str_replace('{PART}
', '.br0
', $part_selector_1);
435 if ( $brackets != '' )
437 $stylesheet .= "\n$brk_selector {{$brackets}}";
440 $strings = get_var('strings
');
441 $string_selector = str_replace('{PART}
', '.st0
', $part_selector_1);
442 if ( $strings != '' )
444 $stylesheet .= "\n$string_selector {{$strings}}";
447 $numbers = get_var('numbers
');
448 $num_selector = str_replace('{PART}
', '.nu0
', $part_selector_1);
449 if ( $numbers != '' )
451 $stylesheet .= "\n$num_selector {{$numbers}}";
454 $methods = get_var('methods
');
455 $method_selector = str_replace('{PART}
', '.me0
', $part_selector_1);
456 if ( $methods != '' )
458 $stylesheet .= "\n$method_selector {{$methods}}";
461 echo "<pre>$stylesheet</pre>";
An exception for terminatinating execution or to throw for unit testing.
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
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file