116                                    {
  117    $value = strtolower($value);
  118}
  119 
  120if ( PHP_SAPI != 'cli' ) { ?>
  121<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  122     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  123<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  124<head>
  125    <title>
GeSHi Language File Validation Script</title>
 
  126    <style type="text/css">
  127    <!--
  128    html {
  129        background-
color: #f0f0f0;
 
  130    }
  131    body {
  132        font-family: Verdana, Arial, sans-serif;
  133        margin: 10px;
  134        border: 2px solid #e0e0e0;
  135        background-
color: #fcfcfc;
 
  136        padding: 5px;
  138    }
  139    h2 {
  140        margin: .1em 0 .2em .5em;
  141        border-bottom: 1px solid #b0b0b0;
  143        font-weight: normal;
  145    }
  146    h3 {
  147        margin: .1em 0 .2em .5em;
  149        font-weight: normal;
  151    }
  152    #footer {
  153        text-align: center;
  156    }
  157    #footer a {
  159    }
  161        border: 1px solid #b0b0b0;
  165    }
  168    }
  172    }
  173    -->
  174    </style>
  175</head>
  176<body>
  177<h2>
GeSHi Language File Validation Script</h2>
 
  178<
p>To use 
this script, make sure that <strong>
geshi.php</strong> is in the
 
  179parent directory or in your include_path, and that the language files are in a
  180subdirectory of 
GeSHi's directory called <strong>geshi/</strong>.</p> 
  181<p>Everything else will be done by this script automatically. After the script
  182finished you should see messages of what could cause trouble with GeSHi or where
  183your language files can be improved. Please be patient, as this might take some time.</p>
  184 
  185<ol>
  186<li>Checking where to find GeSHi installation ...<?php
  187} else { ?>
  188<?php echo colorize(TYPE_NOTICE, "#### GeSHi Language File Validation Script ####") ?>
  189 
  190 
  191To use this script, make sure that <?php echo colorize(TYPE_NOTICE, "geshi.php"); ?> is in the
  192parent directory or in your include_path, and that the language files are in a
  194 
  195Everything else will be done by this script automatically. After the script
  196finished you should see messages of what could cause trouble with 
GeSHi or where
 
  197your language files can be improved. Please be patient, as this might take some time.
  198 
  199 
  200Checking where to find 
GeSHi installation ...<?
php echo 
"\t";
 
  201}
  202 
  203
  204
  205
  206if (is_readable('../geshi.php')) {
  208} elseif (is_readable('geshi.php')) {
  210} else {
  212}
  213 
  215    require 
$path . 
'geshi.php';
 
  216 
  217    if(!class_exists('GeSHi')) {
  218        report_error(
TYPE_ERROR, 
'The GeSHi class was not found, although it seemed we loaded the correct file!');
 
  219    }
  220}
  221 
  223    if(!
defined(
'GESHI_LANG_ROOT')) {
 
  229    }
  230}
  231 
  233 
  235    if ( PHP_SAPI == 'cli' ) {
  236        echo "Listing available language files ...\t\t";
  237    } else {
  238        echo "</li>\n<li>Listing available language files ... ";
  239    }
  240 
  243    }
  244 
  246 
  248        while (
$file = readdir($dir)) {
 
  250                continue;
  251            }
  254                continue;
  255            }
  257        }
  258        closedir($dir);
  259    }
  260 
  263 
  266    }
  267 
  269}
  270 
  271if ( PHP_SAPI == 'cli' ) {
  274    }
  275} else {
  276    if (isset($_REQUEST[
'show']) && in_array($_REQUEST[
'show'], 
$languages)) {
 
  278    }
  279}
  280 
  283 
  284        if ( PHP_SAPI == 'cli' ) {
  285            echo "Validating language file for '$lang' ...\t\t";
  286        } else {
  287            echo "</li>\n<li>Validating language file for '$lang' ... ";
  288        }
  289 
  291 
  293 
  294        if(!is_file($langfile)) {
  296        } elseif(!is_readable($langfile)) {
  298        } else {
  299            $langfile_content = file_get_contents($langfile);
  300            if(preg_match("/\?>(?:\r?\n|\r(?!\n)){2,}\Z/", $langfile_content)) {
  302            }
  303            if(preg_match("/\?>(?:\r?\n|\r(?!\n))?\Z/", $langfile_content)) {
  305            }
  306            if(!preg_match("/(?:\r?\n|\r(?!\n))\Z/", $langfile_content)) {
  308            }
  309            if(preg_match("/(\r?\n|\r(?!\n))\\1\Z/", $langfile_content)) {
  311            }
  312            if(preg_match("/[\x20\t]$/m", $langfile_content)) {
  314            }
  315            if(preg_match("/\t/", $langfile_content)) {
  317            }
  318            if(preg_match('/^(?:    )*(?!    )(?! \*) /m', $langfile_content)) {
  319                report_error(
TYPE_NOTICE, 
'Language file contains irregular indentation (other than 4 spaces per indentation level)!');
 
  320            }
  321 
  322            if(!preg_match("/\/\*\*((?!\*\/).)*?Author:((?!\*\/).)*?\*\//s", $langfile_content)) {
  324            }
  325            if(!preg_match("/\/\*\*((?!\*\/).)*?Copyright:((?!\*\/).)*?\*\//s", $langfile_content)) {
  327            }
  328            if(!preg_match("/\/\*\*((?!\*\/).)*?Release Version:((?!\*\/).)*?\*\//s", $langfile_content)) {
  330            }
  331            if(!preg_match("/\/\*\*((?!\*\/).)*?Date Started:((?!\*\/).)*?\*\//s", $langfile_content)) {
  333            }
  334            if(!preg_match("/\/\*\*((?!\*\/).)*?This file is part of GeSHi\.((?!\*\/).)*?\*\//s", $langfile_content)) {
  336            }
  337            if(!preg_match("/\/\*\*((?!\*\/).)*?language file for GeSHi\.((?!\*\/).)*?\*\//s", $langfile_content)) {
  339            }
  340            if(!preg_match("/\/\*\*((?!\*\/).)*?GNU General Public License((?!\*\/).)*?\*\//s", $langfile_content)) {
  342            }
  343 
  344            unset($langfile_content);
  345 
  346            include $langfile;
  347 
  352            }
  353        }
  354 
  359                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'LANG_NAME\'] specification which is not a string!');
 
  360            }
  361 
  363                report_error(
TYPE_ERROR, 
'Language file contains no $language_data[\'COMMENT_SIGNLE\'] structure to check!');
 
  365                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'COMMENT_SINGLE\'] structure which is not an array!');
 
  366            }
  367 
  369                report_error(
TYPE_ERROR, 
'Language file contains no $language_data[\'COMMENT_MULTI\'] structure to check!');
 
  371                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'COMMENT_MULTI\'] structure which is not an array!');
 
  372            }
  373 
  376                    report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'COMMENT_REGEXP\'] structure which is not an array!');
 
  377                }
  378            }
  379 
  383                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'QUOTEMARKS\'] structure which is not an array!');
 
  384            }
  385 
  388                    report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'HARDQUOTE\'] structure which is not an array!');
 
  389                }
  390            }
  391 
  393                report_error(
TYPE_ERROR, 
'Language file contains no $language_data[\'ESCAPE_CHAR\'] specification to check!');
 
  395                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'ESCAPE_CHAR\'] specification which is not a string!');
 
  397                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'ESCAPE_CHAR\'] specification is not empty or exactly one char!');
 
  398            }
  399 
  403                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'CASE_KEYWORDS\'] specification which is not an integer!');
 
  407                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'CASE_KEYWORDS\'] specification which is neither of GESHI_CAPS_NO_CHANGE, GESHI_CAPS_LOWER nor GESHI_CAPS_UPPER!');
 
  408            }
  409 
  413                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'KEYWORDS\'] structure which is not an array!');
 
  414            } else {
  416                    if(!is_integer($kw_key)) {
  417                        report_error(
TYPE_WARNING, 
"Language file contains an key '$kw_key' in \$language_data['KEYWORDS'] that is not integer!");
 
  418                    } elseif (!is_array($kw_value)) {
  419                        report_error(
TYPE_ERROR, 
"Language file contains a \$language_data['KEYWORDS']['$kw_value'] structure which is not an array!");
 
  420                    }
  421                }
  422            }
  423 
  427                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'SYMBOLS\'] structure which is not an array!');
 
  428            }
  429 
  431                report_error(
TYPE_ERROR, 
'Language file contains no $language_data[\'CASE_SENSITIVE\'] structure to check!');
 
  433                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'CASE_SENSITIVE\'] structure which is not an array!');
 
  434            } else {
  435                foreach(
$language_data[
'CASE_SENSITIVE'] as $cs_key => $cs_value) {
 
  436                    if(!is_integer($cs_key)) {
  437                        report_error(
TYPE_WARNING, 
"Language file contains an key '$cs_key' in \$language_data['CASE_SENSITIVE'] that is not integer!");
 
  438                    } elseif (!is_bool($cs_value)) {
  439                        report_error(
TYPE_ERROR, 
"Language file contains a Case Sensitivity specification for \$language_data['CASE_SENSITIVE']['$cs_value'] which is not a boolean!");
 
  440                    }
  441                }
  442            }
  443 
  447                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'URLS\'] structure which is not an array!');
 
  448            } else {
  450                    if(!is_integer($url_key)) {
  451                        report_error(
TYPE_WARNING, 
"Language file contains an key '$url_key' in \$language_data['URLS'] that is not integer!");
 
  452                    } elseif (!is_string($url_value)) {
  453                        report_error(
TYPE_ERROR, 
"Language file contains a Documentation URL specification for \$language_data['URLS']['$url_value'] which is not a string!");
 
  454                    } elseif (preg_match('#&([^;]*(=|$))#U', $url_value)) {
  455                        report_error(
TYPE_ERROR, 
"Language file contains unescaped ampersands (&) in \$language_data['URLS']!");
 
  456                    }
  457                }
  458            }
  459 
  463                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'OOLANG\'] specification which is neither boolean nor integer!');
 
  467                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'OOLANG\'] specification which is neither of false, true or 2!');
 
  468            }
  469 
  471                report_error(
TYPE_ERROR, 
'Language file contains no $language_data[\'OBJECT_SPLITTERS\'] structure to check!');
 
  473                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'OBJECT_SPLITTERS\'] structure which is not an array!');
 
  474            }
  475 
  479                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'REGEXPS\'] structure which is not an array!');
 
  480            }
  481 
  483                report_error(
TYPE_ERROR, 
'Language file contains no $language_data[\'STRICT_MODE_APPLIES\'] specification!');
 
  485                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'STRICT_MODE_APPLIES\'] specification which is not an integer!');
 
  489                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'STRICT_MODE_APPLIES\'] specification which is neither of GESHI_MAYBE, GESHI_ALWAYS nor GESHI_NEVER!');
 
  490            }
  491 
  493                report_error(
TYPE_ERROR, 
'Language file contains no $language_data[\'SCRIPT_DELIMITERS\'] structure to check!');
 
  495                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'SCRIPT_DELIMITERS\'] structure which is not an array!');
 
  496            }
  497 
  499                report_error(
TYPE_ERROR, 
'Language file contains no $language_data[\'HIGHLIGHT_STRICT_BLOCK\'] structure to check!');
 
  501                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'HIGHLIGHT_STRICT_BLOCK\'] structure which is not an array!');
 
  502            }
  503 
  506                    report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'TAB_WIDTH\'] specification which is not an integer!');
 
  508                    report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'TAB_WIDTH\'] specification which is less than 1!');
 
  509                }
  510            }
  511 
  514                    report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'PARSER_CONTROL\'] structure which is not an array!');
 
  515                }
  516            }
  517 
  521                report_error(
TYPE_ERROR, 
'Language file contains a $language_data[\'STYLES\'] structure which is not an array!');
 
  522            } else {
  523                $style_arrays = array('KEYWORDS', 'COMMENTS', 'ESCAPE_CHAR',
  524                    'BRACKETS', 'STRINGS', 'NUMBERS', 'METHODS', 'SYMBOLS',
  525                    'REGEXPS', 'SCRIPT');
  526                foreach($style_arrays as $style_kind) {
  528                        report_error(
TYPE_ERROR, 
"Language file contains no \$language_data['STYLES']['$style_kind'] structure to check!");
 
  530                        report_error(
TYPE_ERROR, 
"Language file contains a \$language_data['STYLES\']['$style_kind'] structure which is not an array!");
 
  531                    } else {
  532                        foreach(
$language_data[
'STYLES'][$style_kind] as $sk_key => $sk_value) {
 
  533                            if(!is_int($sk_key) && ('COMMENTS' != $style_kind && 'MULTI' != $sk_key)
  534                                && !(('STRINGS' == $style_kind || 'ESCAPE_CHAR' == $style_kind) && 'HARD' == $sk_key)) {
  535                                report_error(
TYPE_WARNING, 
"Language file contains an key '$sk_key' in \$language_data['STYLES']['$style_kind'] that is not integer!");
 
  536                            } elseif (!is_string($sk_value)) {
  537                                report_error(
TYPE_WARNING, 
"Language file contains a CSS specification for \$language_data['STYLES']['$style_kind'][$key] which is not a string!");
 
  538                            }
  539                        }
  540                    }
  541                }
  542 
  543                unset($style_arrays);
  544            }
  545        }
  546 
  548            
  551                    report_error(
TYPE_ERROR, 
"Language file contains no \$language_data['CASE_SENSITIVE'] specification for keyword group $key!");
 
  552                }
  554                    report_error(
TYPE_ERROR, 
"Language file contains no \$language_data['URLS'] specification for keyword group $key!");
 
  555                }
  556                if(empty($keywords)) {
  557                    report_error(
TYPE_WARNING, 
"Language file contains an empty keyword list in \$language_data['KEYWORDS'] for group $key!");
 
  558                }
  559                foreach($keywords as $id => $kw) {
  560                    if(!is_string($kw)) {
  561                        report_error(
TYPE_WARNING, 
"Language file contains an non-string entry at \$language_data['KEYWORDS'][$key][$id]!");
 
  562                    } elseif (!strlen($kw)) {
  563                        report_error(
TYPE_ERROR, 
"Language file contains an empty string entry at \$language_data['KEYWORDS'][$key][$id]!");
 
  564                    } elseif (preg_match('/^([\(\)\{\}\[\]\^=.,:;\-+\*\/%\$\"\'\?]|&[\w#]\w*;)+$/i', $kw)) {
  565                        report_error(
TYPE_NOTICE, 
"Language file contains an keyword ('$kw') at \$language_data['KEYWORDS'][$key][$id] which seems to be better suited for the symbols section!");
 
  566                    }
  567                }
  569                    array_walk($keywords, 'dupfind_strtolower');
  570                }
  571                if(count($keywords) != count(array_unique($keywords))) {
  572                    $kw_diffs = array_count_values($keywords);
  573                    foreach($kw_diffs as $kw => $kw_count) {
  574                        if($kw_count > 1) {
  575                            report_error(
TYPE_WARNING, 
"Language file contains per-group duplicate keyword '$kw' in \$language_data['KEYWORDS'][$key]!");
 
  576                        }
  577                    }
  578                }
  579            }
  580 
  581            $disallowed_before = "(?<![a-zA-Z0-9\$_\|\#;>|^&";
  582            $disallowed_after = "(?![a-zA-Z0-9_\|%\\-&;";
  583 
  586                    if($key2 <= $key) {
  587                        continue;
  588                    }
  589                    $kw_diffs = array_intersect($keywords, $keywords2);
  590                    foreach($kw_diffs as $kw) {
  592                            
  593                            $g1_pre = $disallowed_before;
  594                            $g2_pre = $disallowed_before;
  595                            $g1_post = $disallowed_after;
  596                            $g2_post = $disallowed_after;
  597                            if(isset(
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][
'DISALLOWED_BEFORE'])) {
 
  598                                $g1_pre = 
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][
'DISALLOWED_BEFORE'];
 
  599                                $g2_pre = 
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][
'DISALLOWED_BEFORE'];
 
  600                            }
  601                            if(isset(
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][
'DISALLOWED_AFTER'])) {
 
  602                                $g1_post = 
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][
'DISALLOWED_AFTER'];
 
  603                                $g2_post = 
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][
'DISALLOWED_AFTER'];
 
  604                            }
  605 
  606                            if(isset(
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][$key][
'DISALLOWED_BEFORE'])) {
 
  607                                $g1_pre = 
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][$key][
'DISALLOWED_BEFORE'];
 
  608                            }
  609                            if(isset(
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][$key][
'DISALLOWED_AFTER'])) {
 
  610                                $g1_post = 
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][$key][
'DISALLOWED_AFTER'];
 
  611                            }
  612 
  613                            if(isset(
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][$key2][
'DISALLOWED_BEFORE'])) {
 
  614                                $g2_pre = 
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][$key2][
'DISALLOWED_BEFORE'];
 
  615                            }
  616                            if(isset(
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][$key2][
'DISALLOWED_AFTER'])) {
 
  617                                $g2_post = 
$language_data[
'PARSER_CONTROL'][
'KEYWORDS'][$key2][
'DISALLOWED_AFTER'];
 
  618                            }
  619 
  620                            if($g1_pre != $g2_pre || $g1_post != $g2_post) {
  621                                continue;
  622                            }
  623                        }
  624                        report_error(
TYPE_WARNING, 
"Language file contains cross-group duplicate keyword '$kw' in \$language_data['KEYWORDS'][$key] and \$language_data['KEYWORDS'][$key2]!");
 
  625                    }
  626                }
  627            }
  630                    report_error(
TYPE_WARNING, 
"Language file contains an superfluous \$language_data['CASE_SENSITIVE'] specification for non-existing keyword group $key!");
 
  631                }
  632            }
  635                    report_error(
TYPE_WARNING, 
"Language file contains an superfluous \$language_data['URLS'] specification for non-existing keyword group $key!");
 
  636                }
  637            }
  638            foreach(
$language_data[
'STYLES'][
'KEYWORDS'] as $key => $keywords) {
 
  640                    report_error(
TYPE_WARNING, 
"Language file contains an superfluous \$language_data['STYLES']['KEYWORDS'] specification for non-existing keyword group $key!");
 
  641                }
  642            }
  643 
  645                if(!is_int($ck)) {
  646                    report_error(
TYPE_WARNING, 
"Language file contains an key '$ck' in \$language_data['COMMENT_SINGLE'] that is not integer!");
 
  647                }
  648                if(!is_string($cv)) {
  649                    report_error(
TYPE_WARNING, 
"Language file contains an non-string entry at \$language_data['COMMENT_SINGLE'][$ck]!");
 
  650                }
  652                    report_error(
TYPE_WARNING, 
"Language file contains no \$language_data['STYLES']['COMMENTS'] specification for comment group $ck!");
 
  653                }
  654            }
  657                    if(!is_int($ck)) {
  658                        report_error(
TYPE_WARNING, 
"Language file contains an key '$ck' in \$language_data['COMMENT_REGEXP'] that is not integer!");
 
  659                    }
  660                    if(!is_string($cv)) {
  661                        report_error(
TYPE_WARNING, 
"Language file contains an non-string entry at \$language_data['COMMENT_REGEXP'][$ck]!");
 
  662                    }
  664                        report_error(
TYPE_WARNING, 
"Language file contains no \$language_data['STYLES']['COMMENTS'] specification for comment group $ck!");
 
  665                    }
  666                }
  667            }
  669                if($ck != 
'MULTI' && !isset(
$language_data[
'COMMENT_SINGLE'][$ck]) &&
 
  671                    report_error(
TYPE_NOTICE, 
"Language file contains an superfluous \$language_data['STYLES']['COMMENTS'] specification for Single Line or Regular-Expression Comment key $ck!");
 
  672                }
  673            }
  676                    report_error(
TYPE_NOTICE, 
"Language file contains superfluous \$language_data['STYLES']['STRINGS'] specification for key 'HARD', but no 'HARDQUOTE's are defined!");
 
  677                }
  679            }
  682                    report_error(
TYPE_NOTICE, 
"Language file contains an superfluous \$language_data['STYLES']['STRINGS'] specification for non-existing quotemark key $sk!");
 
  683                }
  684            }
  685 
  687                if(!is_int($rk)) {
  688                    report_error(
TYPE_WARNING, 
"Language file contains an key '$rk' in \$language_data['REGEXPS'] that is not integer!");
 
  689                }
  690                if(is_string($rv)) {
  691                    
  692                    if(empty($rv)) {
  693                        report_error(
TYPE_WARNING, 
"Language file contains an empty regular expression at \$language_data['REGEXPS'][$rk]!");
 
  694                    } else {
  695                        if(preg_match("/(?<!\\\\)\//s", $rv)) {
  696                            report_error(
TYPE_WARNING, 
"Language file contains a regular expression with an unmasked / character at \$language_data['REGEXPS'][$rk]!");
 
  697                        } elseif (preg_match("/(?<!<)(\\\\\\\\)*\\\\\|(?!>)/s", $rv)) {
  698                            report_error(
TYPE_WARNING, 
"Language file contains a regular expression with an unescaped match for a pipe character '|' which needs escaping as '<PIPE>' instead at \$language_data['REGEXPS'][$rk]!");
 
  699                        }
  700                    }
  701                } elseif(is_array($rv)) {
  703                        report_error(
TYPE_ERROR, 
"Language file contains no GESHI_SEARCH entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
 
  705                        report_error(
TYPE_ERROR, 
"Language file contains a GESHI_SEARCH entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
 
  706                    } else {
  708                            report_error(
TYPE_WARNING, 
"Language file contains a regular expression with an unmasked / character at \$language_data['REGEXPS'][$rk]!");
 
  709                        } elseif (preg_match(
"/(?<!<)(\\\\\\\\)*\\\\\|(?!>)/s", $rv[
GESHI_SEARCH])) {
 
  710                            report_error(
TYPE_WARNING, 
"Language file contains a regular expression with an unescaped match for a pipe character '|' which needs escaping as '<PIPE>' instead at \$language_data['REGEXPS'][$rk]!");
 
  711                        }
  712                    }
  714                        report_error(
TYPE_WARNING, 
"Language file contains no GESHI_REPLACE entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
 
  716                        report_error(
TYPE_ERROR, 
"Language file contains a GESHI_REPLACE entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
 
  717                    }
  719                        report_error(
TYPE_WARNING, 
"Language file contains no GESHI_MODIFIERS entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
 
  721                        report_error(
TYPE_ERROR, 
"Language file contains a GESHI_MODIFIERS entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
 
  722                    }
  724                        report_error(
TYPE_WARNING, 
"Language file contains no GESHI_BEFORE entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
 
  726                        report_error(
TYPE_ERROR, 
"Language file contains a GESHI_BEFORE entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
 
  727                    }
  729                        report_error(
TYPE_WARNING, 
"Language file contains no GESHI_AFTER entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
 
  731                        report_error(
TYPE_ERROR, 
"Language file contains a GESHI_AFTER entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
 
  732                    }
  733                } else {
  734                    report_error(
TYPE_WARNING, 
"Language file contains an non-string and non-array entry at \$language_data['REGEXPS'][$rk]!");
 
  735                }
  737                    report_error(
TYPE_WARNING, 
"Language file contains no \$language_data['STYLES']['REGEXPS'] specification for regexp group $rk!");
 
  738                }
  739            }
  742                    report_error(
TYPE_NOTICE, 
"Language file contains an superfluous \$language_data['STYLES']['REGEXPS'] specification for regexp key $rk!");
 
  743                }
  744            }
  745 
  746 
  747        }
  748 
  750 
  751        flush();
  752 
  754            break;
  755        }
  756    }
  757}
  758 
  761 
  762if ( PHP_SAPI != 'cli' ) {
  763?></li>
  764</ol>
  765 
  766<
p>Validation process completed in <?
php printf(
"%.2f", 
$time_diff); ?> seconds.</
p>
 
  767 
  768<div 
id=
"footer">
GeSHi © 2004-2007 Nigel McNie, 2007-2008 Benny Baumann, released under the GNU GPL</div>
 
  769</body>
  770</html>
  771 
An exception for terminatinating execution or to throw for unit testing.
const GESHI_MAYBE
Strict mode might apply, and can be enabled or disabled by GeSHi->enable_strict_mode().
const GESHI_CAPS_NO_CHANGE
Lowercase keywords found.
const GESHI_BEFORE
The key of the regex array defining what bracket group in a matched search to put before the replacem...
const GESHI_SEARCH
The key of the regex array defining what to search for.
const GESHI_LANG_ROOT(!defined('GESHI_ROOT'))
The language file directory for GeSHi @access private.
const GESHI_AFTER
The key of the regex array defining what bracket group in a matched search to put after the replaceme...
const GESHI_ALWAYS
Strict mode always applies.
const GESHI_REPLACE
The key of the regex array defining what bracket group in a matched search to use as a replacement.
const GESHI_CAPS_LOWER
Leave keywords found as the case that they are.
const GESHI_COMMENTS
Used in language files to mark comments.
const GESHI_NEVER
#+ @access private
const GESHI_MODIFIERS
The key of the regex array defining any modifiers to the regular expression.
const GESHI_CAPS_UPPER
Uppercase keywords found.
if(PHP_SAPI !='cli') color
colorize($level, $string)
report_error($type, $message)
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
A simple script which outputs the CSS classes for all languages supported by GeSHi.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']