Wordfence Security – Firewall & Malware Scan - Version 2.0.5

Version Description

  • If your plugin PHP files are viewable by the world, we now give you a detailed warning on the seriousness of this security threat with ability to view the offending .htaccess files.
  • Added a debug mode in options for very verbose logging and marking errors in red.
  • Added more logging for the process that starts the security scan.
  • Ability to securely view the entire activity log added.
  • Using plugin version in all CSS URL's instead of API version.
  • Activity log microtime is more accurate now.
  • Fixed bug that would cause security scanning of PHP files with base64 content to stop.
Download this release

Release Info

Developer mmaunder
Plugin Icon 128x128 Wordfence Security – Firewall & Malware Scan
Version 2.0.5
Comparing to
See all releases

Code changes from version 2.0.3 to 2.0.5

.htaccess ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <Files .htaccess>
2
+ Order Allow,Deny
3
+ Deny From All
4
+ </Files>
5
+ <Files readme.txt>
6
+ Order Allow,Deny
7
+ Deny From All
8
+ </Files>
9
+ <Files screenshot-1.png>
10
+ Order Allow,Deny
11
+ Deny From All
12
+ </Files>
13
+ <Files screenshot-2.png>
14
+ Order Allow,Deny
15
+ Deny From All
16
+ </Files>
17
+ <Files screenshot-3.png>
18
+ Order Allow,Deny
19
+ Deny From All
20
+ </Files>
21
+ <Files screenshot-4.png>
22
+ Order Allow,Deny
23
+ Deny From All
24
+ </Files>
25
+ <Files screenshot-5.png>
26
+ Order Allow,Deny
27
+ Deny From All
28
+ </Files>
29
+ DirectoryIndex index.html
30
+ IndexIgnore *
31
+ Options -Indexes
css/fullLog.css ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body {
2
+ background: #fff;
3
+ font-family: Arial;
4
+ font-size: 12px;
5
+ }
6
+ h1 {
7
+ background: url(../images/wordfence-logo-64x64.png);
8
+ background-position: 0 0;
9
+ background-repeat: no-repeat;
10
+ height: 64px;
11
+ vertical-align: middle;
12
+ padding: 10px 0 0 70px;
13
+ margin: 20px 0 10px 0;
14
+ font-size: 34px;
15
+ color: #777;
16
+ }
17
+ .error {
18
+ color: #F00;
19
+ font-weight: bold;
20
+ margin: 20px 0 20px 0;
21
+ }
css/main.css CHANGED
@@ -187,18 +187,22 @@ table th.wfConfigEnable { font-weight: bold; }
187
  table th.wfSubheading { font-weight: bold; padding-top: 10px; }
188
  .wfALogTime { color: #999; }
189
  .wfALogEntry { }
190
- .wfALogMailLink {
191
  display: block;
192
  position: absolute;
193
  padding: 0 0 0 18px;
194
  margin: 0;
195
  right: 10px;
196
  top: 0px;
197
- background-image: url(../images/icons/email_go.png);
198
  background-repeat: no-repeat;
199
  font-weight: normal;
200
  }
201
-
 
 
 
 
 
202
  #wfActivity { position: relative; }
203
  h3.wfConfigHeading {
204
  font-size: 22px;
@@ -228,7 +232,7 @@ h3.wfConfigHeading {
228
  -webkit-font-smoothing: antialiased;
229
 
230
  }
231
- .consoleOuter { width: 800px; margin-bottom: 20px; }
232
  .consoleInner { height: 116px; overflow: auto; z-index: 1; }
233
  .bevelDiv1 { border: 1px solid #EFEFEF; }
234
  .bevelDiv2 { border: 1px solid #AAA; }
@@ -261,4 +265,7 @@ h3.wfConfigHeading {
261
  color: #555;
262
  }
263
  input.wfStartScanButton { width: 160px; text-align: left; padding-left: 20px; }
 
 
 
264
 
187
  table th.wfSubheading { font-weight: bold; padding-top: 10px; }
188
  .wfALogTime { color: #999; }
189
  .wfALogEntry { }
190
+ .wfALogMailLink, .wfALogViewLink {
191
  display: block;
192
  position: absolute;
193
  padding: 0 0 0 18px;
194
  margin: 0;
195
  right: 10px;
196
  top: 0px;
 
197
  background-repeat: no-repeat;
198
  font-weight: normal;
199
  }
200
+ .wfALogMailLink {
201
+ background-image: url(../images/icons/email_go.png);
202
+ }
203
+ .wfALogViewLink {
204
+ background-image: url(../images/icons/magnifier.png);
205
+ }
206
  #wfActivity { position: relative; }
207
  h3.wfConfigHeading {
208
  font-size: 22px;
232
  -webkit-font-smoothing: antialiased;
233
 
234
  }
235
+ .consoleOuter { width: 800px; }
236
  .consoleInner { height: 116px; overflow: auto; z-index: 1; }
237
  .bevelDiv1 { border: 1px solid #EFEFEF; }
238
  .bevelDiv2 { border: 1px solid #AAA; }
265
  color: #555;
266
  }
267
  input.wfStartScanButton { width: 160px; text-align: left; padding-left: 20px; }
268
+ .wferror {
269
+ color: #F00;
270
+ }
271
 
images/icons/magnifier.png ADDED
Binary file
js/admin.js CHANGED
@@ -26,11 +26,14 @@ window['wordfenceAdmin'] = {
26
  totalActAdded: 0,
27
  maxActivityLogItems: 1000,
28
  scanReqAnimation: false,
 
29
  init: function(){
30
  this.nonce = WordfenceAdminVars.firstNonce;
 
31
  var startTicker = false;
32
  if(jQuery('#wordfenceMode_scan').length > 0){
33
  this.mode = 'scan';
 
34
  jQuery('#consoleActivity').scrollTop(jQuery('#consoleActivity').prop('scrollHeight'));
35
  jQuery('#consoleScan').scrollTop(jQuery('#consoleScan').prop('scrollHeight'));
36
  this.noScanHTML = jQuery('#wfNoScanYetTmpl').tmpl().html();
@@ -138,8 +141,14 @@ window['wordfenceAdmin'] = {
138
  this.processSummaryLine(item);
139
  jQuery('#consoleSummary').scrollTop(jQuery('#consoleSummary').prop('scrollHeight'));
140
  jQuery('#wfStartingScan').addClass('wfSummaryOK').html('Done.');
141
- } else {
142
- jQuery('#consoleActivity').append('<div class="wfActivityLine wf' + item.type + '">[' + item.date + ']&nbsp;' + item.msg + '</div>');
 
 
 
 
 
 
143
  if(/Scan complete\./i.test(item.msg)){
144
  this.loadIssues();
145
  }
@@ -164,11 +173,11 @@ window['wordfenceAdmin'] = {
164
  summaryUpdated = true;
165
  } else if(item.msg.indexOf('SUM_DISABLED:') != -1){
166
  var msg = item.msg.replace('SUM_DISABLED:', '');
167
- jQuery('#consoleSummary').append('<div class="wfSummaryLine"><div class="wfSummaryDate">[' + item.date + ']</div><div class="wfSummaryMsg">' + msg + '</div><div class="wfSummaryResult">Disabled</div><div class="wfClear"></div>');
168
  summaryUpdated = true;
169
  } else if(item.msg.indexOf('SUM_PAIDONLY:') != -1){
170
  var msg = item.msg.replace('SUM_PAIDONLY:', '');
171
- jQuery('#consoleSummary').append('<div class="wfSummaryLine"><div class="wfSummaryDate">[' + item.date + ']</div><div class="wfSummaryMsg">' + msg + '</div><div class="wfSummaryResult"><a href="http://www.wordfence.com/" target="_blank">Paid Members Only</a></div><div class="wfClear"></div>');
172
  summaryUpdated = true;
173
  } else if(item.msg.indexOf('SUM_FINAL:') != -1){
174
  var msg = item.msg.replace('SUM_FINAL:', '');
@@ -770,7 +779,10 @@ window['wordfenceAdmin'] = {
770
  this.ajax('wordfence_saveConfig', qstr, function(res){
771
  jQuery('.wfAjax24').hide();
772
  if(res.ok){
773
- if(res['reload'] == 'reload' || WFAD.reloadConfigPage){
 
 
 
774
  self.colorbox('400px', "Please reload this page", "You selected a config option that requires a page reload. Click the button below to reload this page to update the menu.<br /><br /><center><input type='button' name='wfReload' value='Reload page' onclick='window.location.reload();' /></center>");
775
  return;
776
  } else {
26
  totalActAdded: 0,
27
  maxActivityLogItems: 1000,
28
  scanReqAnimation: false,
29
+ debugOn: false,
30
  init: function(){
31
  this.nonce = WordfenceAdminVars.firstNonce;
32
+ this.debugOn = WordfenceAdminVars.debugOn == '1' ? true : false;
33
  var startTicker = false;
34
  if(jQuery('#wordfenceMode_scan').length > 0){
35
  this.mode = 'scan';
36
+ jQuery('#wfALogViewLink').prop('href', WordfenceAdminVars.siteBaseURL + '?_wfsf=viewActivityLog&nonce=' + this.nonce);
37
  jQuery('#consoleActivity').scrollTop(jQuery('#consoleActivity').prop('scrollHeight'));
38
  jQuery('#consoleScan').scrollTop(jQuery('#consoleScan').prop('scrollHeight'));
39
  this.noScanHTML = jQuery('#wfNoScanYetTmpl').tmpl().html();
141
  this.processSummaryLine(item);
142
  jQuery('#consoleSummary').scrollTop(jQuery('#consoleSummary').prop('scrollHeight'));
143
  jQuery('#wfStartingScan').addClass('wfSummaryOK').html('Done.');
144
+ } else if(this.debugOn || item.level < 4){
145
+
146
+ var html = '<div class="wfActivityLine';
147
+ if(this.debugOn){
148
+ html += ' wf' + item.type;
149
+ }
150
+ html += '">[' + item.date + ']&nbsp;' + item.msg + '</div>';
151
+ jQuery('#consoleActivity').append(html);
152
  if(/Scan complete\./i.test(item.msg)){
153
  this.loadIssues();
154
  }
173
  summaryUpdated = true;
174
  } else if(item.msg.indexOf('SUM_DISABLED:') != -1){
175
  var msg = item.msg.replace('SUM_DISABLED:', '');
176
+ jQuery('#consoleSummary').append('<div class="wfSummaryLine"><div class="wfSummaryDate">[' + item.date + ']</div><div class="wfSummaryMsg">' + msg + '</div><div class="wfSummaryResult">Disabled [<a href="admin.php?page=WordfenceSecOpt">Visit Options to Enable</a>]</div><div class="wfClear"></div>');
177
  summaryUpdated = true;
178
  } else if(item.msg.indexOf('SUM_PAIDONLY:') != -1){
179
  var msg = item.msg.replace('SUM_PAIDONLY:', '');
180
+ jQuery('#consoleSummary').append('<div class="wfSummaryLine"><div class="wfSummaryDate">[' + item.date + ']</div><div class="wfSummaryMsg">' + msg + '</div><div class="wfSummaryResult"><a href="https://www.wordfence.com/choose-a-wordfence-membership-type/?s2-ssl=yes" target="_blank">Paid Members Only</a></div><div class="wfClear"></div>');
181
  summaryUpdated = true;
182
  } else if(item.msg.indexOf('SUM_FINAL:') != -1){
183
  var msg = item.msg.replace('SUM_FINAL:', '');
779
  this.ajax('wordfence_saveConfig', qstr, function(res){
780
  jQuery('.wfAjax24').hide();
781
  if(res.ok){
782
+ if(res['paidKeyMsg']){
783
+ self.colorbox('400px', "Congratulations! You have been upgraded to Premium Scanning.", "You have upgraded to a Premium API key. Once this page reloads, you can choose which premium scanning options you would like to enable and then click save. Click the button below to reload this page now.<br /><br /><center><input type='button' name='wfReload' value='Reload page and enable Premium options' onclick='window.location.reload();' /></center>");
784
+ return;
785
+ } else if(res['reload'] == 'reload' || WFAD.reloadConfigPage){
786
  self.colorbox('400px', "Please reload this page", "You selected a config option that requires a page reload. Click the button below to reload this page to update the menu.<br /><br /><center><input type='button' name='wfReload' value='Reload page' onclick='window.location.reload();' /></center>");
787
  return;
788
  } else {
lib/IPTraf.php CHANGED
@@ -2,7 +2,7 @@
2
  <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
- <link rel='stylesheet' id='wordfence-main-style-css' href='<?php echo wfUtils::getBaseURL(); ?>/css/iptraf.css?ver=<?php echo WORDFENCE_VERSION ?>' type='text/css' media='all' />
6
  <body>
7
  <h1>Wordfence: All recent hits for IP address <?php echo $IP; if($reverseLookup){ echo '[' . $reverseLookup . ']'; } ?></h1>
8
  <table border="0" cellpadding="2" cellspacing="0" style="width: 900px;">
2
  <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
+ <link rel='stylesheet' id='wordfence-main-style-css' href='<?php echo wfUtils::getBaseURL(); ?>/css/iptraf.css?ver=<?php echo wfUtils::myVersion(); ?>' type='text/css' media='all' />
6
  <body>
7
  <h1>Wordfence: All recent hits for IP address <?php echo $IP; if($reverseLookup){ echo '[' . $reverseLookup . ']'; } ?></h1>
8
  <table border="0" cellpadding="2" cellspacing="0" style="width: 900px;">
lib/diffResult.php CHANGED
@@ -2,7 +2,7 @@
2
  <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
- <link rel='stylesheet' id='wordfence-main-style-css' href='<?php echo wfUtils::getBaseURL(); ?>/css/diff.css?ver=<?php echo WORDFENCE_VERSION ?>' type='text/css' media='all' />
6
  <body>
7
  <h1>Wordfence: Viewing File Differences</h1>
8
  <p style="width: 800px; font-size: 16px; font-family: Verdana;">
2
  <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
+ <link rel='stylesheet' id='wordfence-main-style-css' href='<?php echo wfUtils::getBaseURL(); ?>/css/diff.css?ver=<?php echo wfUtils::myVersion(); ?>' type='text/css' media='all' />
6
  <body>
7
  <h1>Wordfence: Viewing File Differences</h1>
8
  <p style="width: 800px; font-size: 16px; font-family: Verdana;">
lib/geshi.php DELETED
@@ -1,4755 +0,0 @@
1
- <?php
2
- /**
3
- * GeSHi - Generic Syntax Highlighter
4
- *
5
- * The GeSHi class for Generic Syntax Highlighting. Please refer to the
6
- * documentation at http://qbnz.com/highlighter/documentation.php for more
7
- * information about how to use this class.
8
- *
9
- * For changes, release notes, TODOs etc, see the relevant files in the docs/
10
- * directory.
11
- *
12
- * This file is part of GeSHi.
13
- *
14
- * GeSHi is free software; you can redistribute it and/or modify
15
- * it under the terms of the GNU General Public License as published by
16
- * the Free Software Foundation; either version 2 of the License, or
17
- * (at your option) any later version.
18
- *
19
- * GeSHi is distributed in the hope that it will be useful,
20
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- * GNU General Public License for more details.
23
- *
24
- * You should have received a copy of the GNU General Public License
25
- * along with GeSHi; if not, write to the Free Software
26
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
- *
28
- * @package geshi
29
- * @subpackage core
30
- * @author Nigel McNie <nigel@geshi.org>, Benny Baumann <BenBE@omorphia.de>
31
- * @copyright (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann
32
- * @license http://gnu.org/copyleft/gpl.html GNU GPL
33
- *
34
- */
35
-
36
- //
37
- // GeSHi Constants
38
- // You should use these constant names in your programs instead of
39
- // their values - you never know when a value may change in a future
40
- // version
41
- //
42
-
43
- /** The version of this GeSHi file */
44
- define('GESHI_VERSION', '1.0.8.10');
45
-
46
- // Define the root directory for the GeSHi code tree
47
- if (!defined('GESHI_ROOT')) {
48
- /** The root directory for GeSHi */
49
- define('GESHI_ROOT', dirname(__FILE__) . DIRECTORY_SEPARATOR);
50
- }
51
- /** The language file directory for GeSHi
52
- @access private */
53
- define('GESHI_LANG_ROOT', GESHI_ROOT . 'geshi' . DIRECTORY_SEPARATOR);
54
-
55
- // Define if GeSHi should be paranoid about security
56
- if (!defined('GESHI_SECURITY_PARANOID')) {
57
- /** Tells GeSHi to be paranoid about security settings */
58
- define('GESHI_SECURITY_PARANOID', true);
59
- }
60
-
61
- // Line numbers - use with enable_line_numbers()
62
- /** Use no line numbers when building the result */
63
- define('GESHI_NO_LINE_NUMBERS', 0);
64
- /** Use normal line numbers when building the result */
65
- define('GESHI_NORMAL_LINE_NUMBERS', 1);
66
- /** Use fancy line numbers when building the result */
67
- define('GESHI_FANCY_LINE_NUMBERS', 2);
68
-
69
- // Container HTML type
70
- /** Use nothing to surround the source */
71
- define('GESHI_HEADER_NONE', 0);
72
- /** Use a "div" to surround the source */
73
- define('GESHI_HEADER_DIV', 1);
74
- /** Use a "pre" to surround the source */
75
- define('GESHI_HEADER_PRE', 2);
76
- /** Use a pre to wrap lines when line numbers are enabled or to wrap the whole code. */
77
- define('GESHI_HEADER_PRE_VALID', 3);
78
- /**
79
- * Use a "table" to surround the source:
80
- *
81
- * <table>
82
- * <thead><tr><td colspan="2">$header</td></tr></thead>
83
- * <tbody><tr><td><pre>$linenumbers</pre></td><td><pre>$code></pre></td></tr></tbody>
84
- * <tfooter><tr><td colspan="2">$footer</td></tr></tfoot>
85
- * </table>
86
- *
87
- * this is essentially only a workaround for Firefox, see sf#1651996 or take a look at
88
- * https://bugzilla.mozilla.org/show_bug.cgi?id=365805
89
- * @note when linenumbers are disabled this is essentially the same as GESHI_HEADER_PRE
90
- */
91
- define('GESHI_HEADER_PRE_TABLE', 4);
92
-
93
- // Capatalisation constants
94
- /** Lowercase keywords found */
95
- define('GESHI_CAPS_NO_CHANGE', 0);
96
- /** Uppercase keywords found */
97
- define('GESHI_CAPS_UPPER', 1);
98
- /** Leave keywords found as the case that they are */
99
- define('GESHI_CAPS_LOWER', 2);
100
-
101
- // Link style constants
102
- /** Links in the source in the :link state */
103
- define('GESHI_LINK', 0);
104
- /** Links in the source in the :hover state */
105
- define('GESHI_HOVER', 1);
106
- /** Links in the source in the :active state */
107
- define('GESHI_ACTIVE', 2);
108
- /** Links in the source in the :visited state */
109
- define('GESHI_VISITED', 3);
110
-
111
- // Important string starter/finisher
112
- // Note that if you change these, they should be as-is: i.e., don't
113
- // write them as if they had been run through htmlentities()
114
- /** The starter for important parts of the source */
115
- define('GESHI_START_IMPORTANT', '<BEGIN GeSHi>');
116
- /** The ender for important parts of the source */
117
- define('GESHI_END_IMPORTANT', '<END GeSHi>');
118
-
119
- /**#@+
120
- * @access private
121
- */
122
- // When strict mode applies for a language
123
- /** Strict mode never applies (this is the most common) */
124
- define('GESHI_NEVER', 0);
125
- /** Strict mode *might* apply, and can be enabled or
126
- disabled by {@link GeSHi->enable_strict_mode()} */
127
- define('GESHI_MAYBE', 1);
128
- /** Strict mode always applies */
129
- define('GESHI_ALWAYS', 2);
130
-
131
- // Advanced regexp handling constants, used in language files
132
- /** The key of the regex array defining what to search for */
133
- define('GESHI_SEARCH', 0);
134
- /** The key of the regex array defining what bracket group in a
135
- matched search to use as a replacement */
136
- define('GESHI_REPLACE', 1);
137
- /** The key of the regex array defining any modifiers to the regular expression */
138
- define('GESHI_MODIFIERS', 2);
139
- /** The key of the regex array defining what bracket group in a
140
- matched search to put before the replacement */
141
- define('GESHI_BEFORE', 3);
142
- /** The key of the regex array defining what bracket group in a
143
- matched search to put after the replacement */
144
- define('GESHI_AFTER', 4);
145
- /** The key of the regex array defining a custom keyword to use
146
- for this regexp's html tag class */
147
- define('GESHI_CLASS', 5);
148
-
149
- /** Used in language files to mark comments */
150
- define('GESHI_COMMENTS', 0);
151
-
152
- /** Used to work around missing PHP features **/
153
- define('GESHI_PHP_PRE_433', !(version_compare(PHP_VERSION, '4.3.3') === 1));
154
-
155
- /** make sure we can call stripos **/
156
- if (!function_exists('stripos')) {
157
- // the offset param of preg_match is not supported below PHP 4.3.3
158
- if (GESHI_PHP_PRE_433) {
159
- /**
160
- * @ignore
161
- */
162
- function stripos($haystack, $needle, $offset = null) {
163
- if (!is_null($offset)) {
164
- $haystack = substr($haystack, $offset);
165
- }
166
- if (preg_match('/'. preg_quote($needle, '/') . '/', $haystack, $match, PREG_OFFSET_CAPTURE)) {
167
- return $match[0][1];
168
- }
169
- return false;
170
- }
171
- }
172
- else {
173
- /**
174
- * @ignore
175
- */
176
- function stripos($haystack, $needle, $offset = null) {
177
- if (preg_match('/'. preg_quote($needle, '/') . '/', $haystack, $match, PREG_OFFSET_CAPTURE, $offset)) {
178
- return $match[0][1];
179
- }
180
- return false;
181
- }
182
- }
183
- }
184
-
185
- /** some old PHP / PCRE subpatterns only support up to xxx subpatterns in
186
- regular expressions. Set this to false if your PCRE lib is up to date
187
- @see GeSHi->optimize_regexp_list()
188
- **/
189
- define('GESHI_MAX_PCRE_SUBPATTERNS', 500);
190
- /** it's also important not to generate too long regular expressions
191
- be generous here... but keep in mind, that when reaching this limit we
192
- still have to close open patterns. 12k should do just fine on a 16k limit.
193
- @see GeSHi->optimize_regexp_list()
194
- **/
195
- define('GESHI_MAX_PCRE_LENGTH', 12288);
196
-
197
- //Number format specification
198
- /** Basic number format for integers */
199
- define('GESHI_NUMBER_INT_BASIC', 1); //Default integers \d+
200
- /** Enhanced number format for integers like seen in C */
201
- define('GESHI_NUMBER_INT_CSTYLE', 2); //Default C-Style \d+[lL]?
202
- /** Number format to highlight binary numbers with a suffix "b" */
203
- define('GESHI_NUMBER_BIN_SUFFIX', 16); //[01]+[bB]
204
- /** Number format to highlight binary numbers with a prefix % */
205
- define('GESHI_NUMBER_BIN_PREFIX_PERCENT', 32); //%[01]+
206
- /** Number format to highlight binary numbers with a prefix 0b (C) */
207
- define('GESHI_NUMBER_BIN_PREFIX_0B', 64); //0b[01]+
208
- /** Number format to highlight octal numbers with a leading zero */
209
- define('GESHI_NUMBER_OCT_PREFIX', 256); //0[0-7]+
210
- /** Number format to highlight octal numbers with a prefix 0o (logtalk) */
211
- define('GESHI_NUMBER_OCT_PREFIX_0O', 512); //0[0-7]+
212
- /** Number format to highlight octal numbers with a leading @ (Used in HiSofts Devpac series). */
213
- define('GESHI_NUMBER_OCT_PREFIX_AT', 1024); //@[0-7]+
214
- /** Number format to highlight octal numbers with a suffix of o */
215
- define('GESHI_NUMBER_OCT_SUFFIX', 2048); //[0-7]+[oO]
216
- /** Number format to highlight hex numbers with a prefix 0x */
217
- define('GESHI_NUMBER_HEX_PREFIX', 4096); //0x[0-9a-fA-F]+
218
- /** Number format to highlight hex numbers with a prefix $ */
219
- define('GESHI_NUMBER_HEX_PREFIX_DOLLAR', 8192); //$[0-9a-fA-F]+
220
- /** Number format to highlight hex numbers with a suffix of h */
221
- define('GESHI_NUMBER_HEX_SUFFIX', 16384); //[0-9][0-9a-fA-F]*h
222
- /** Number format to highlight floating-point numbers without support for scientific notation */
223
- define('GESHI_NUMBER_FLT_NONSCI', 65536); //\d+\.\d+
224
- /** Number format to highlight floating-point numbers without support for scientific notation */
225
- define('GESHI_NUMBER_FLT_NONSCI_F', 131072); //\d+(\.\d+)?f
226
- /** Number format to highlight floating-point numbers with support for scientific notation (E) and optional leading zero */
227
- define('GESHI_NUMBER_FLT_SCI_SHORT', 262144); //\.\d+e\d+
228
- /** Number format to highlight floating-point numbers with support for scientific notation (E) and required leading digit */
229
- define('GESHI_NUMBER_FLT_SCI_ZERO', 524288); //\d+(\.\d+)?e\d+
230
- //Custom formats are passed by RX array
231
-
232
- // Error detection - use these to analyse faults
233
- /** No sourcecode to highlight was specified
234
- * @deprecated
235
- */
236
- define('GESHI_ERROR_NO_INPUT', 1);
237
- /** The language specified does not exist */
238
- define('GESHI_ERROR_NO_SUCH_LANG', 2);
239
- /** GeSHi could not open a file for reading (generally a language file) */
240
- define('GESHI_ERROR_FILE_NOT_READABLE', 3);
241
- /** The header type passed to {@link GeSHi->set_header_type()} was invalid */
242
- define('GESHI_ERROR_INVALID_HEADER_TYPE', 4);
243
- /** The line number type passed to {@link GeSHi->enable_line_numbers()} was invalid */
244
- define('GESHI_ERROR_INVALID_LINE_NUMBER_TYPE', 5);
245
- /**#@-*/
246
-
247
-
248
- /**
249
- * The GeSHi Class.
250
- *
251
- * Please refer to the documentation for GeSHi 1.0.X that is available
252
- * at http://qbnz.com/highlighter/documentation.php for more information
253
- * about how to use this class.
254
- *
255
- * @package geshi
256
- * @author Nigel McNie <nigel@geshi.org>, Benny Baumann <BenBE@omorphia.de>
257
- * @copyright (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann
258
- */
259
- class GeSHi {
260
- /**#@+
261
- * @access private
262
- */
263
- /**
264
- * The source code to highlight
265
- * @var string
266
- */
267
- var $source = '';
268
-
269
- /**
270
- * The language to use when highlighting
271
- * @var string
272
- */
273
- var $language = '';
274
-
275
- /**
276
- * The data for the language used
277
- * @var array
278
- */
279
- var $language_data = array();
280
-
281
- /**
282
- * The path to the language files
283
- * @var string
284
- */
285
- var $language_path = GESHI_LANG_ROOT;
286
-
287
- /**
288
- * The error message associated with an error
289
- * @var string
290
- * @todo check err reporting works
291
- */
292
- var $error = false;
293
-
294
- /**
295
- * Possible error messages
296
- * @var array
297
- */
298
- var $error_messages = array(
299
- GESHI_ERROR_NO_SUCH_LANG => 'GeSHi could not find the language {LANGUAGE} (using path {PATH})',
300
- GESHI_ERROR_FILE_NOT_READABLE => 'The file specified for load_from_file was not readable',
301
- GESHI_ERROR_INVALID_HEADER_TYPE => 'The header type specified is invalid',
302
- GESHI_ERROR_INVALID_LINE_NUMBER_TYPE => 'The line number type specified is invalid'
303
- );
304
-
305
- /**
306
- * Whether highlighting is strict or not
307
- * @var boolean
308
- */
309
- var $strict_mode = false;
310
-
311
- /**
312
- * Whether to use CSS classes in output
313
- * @var boolean
314
- */
315
- var $use_classes = false;
316
-
317
- /**
318
- * The type of header to use. Can be one of the following
319
- * values:
320
- *
321
- * - GESHI_HEADER_PRE: Source is outputted in a "pre" HTML element.
322
- * - GESHI_HEADER_DIV: Source is outputted in a "div" HTML element.
323
- * - GESHI_HEADER_NONE: No header is outputted.
324
- *
325
- * @var int
326
- */
327
- var $header_type = GESHI_HEADER_PRE;
328
-
329
- /**
330
- * Array of permissions for which lexics should be highlighted
331
- * @var array
332
- */
333
- var $lexic_permissions = array(
334
- 'KEYWORDS' => array(),
335
- 'COMMENTS' => array('MULTI' => true),
336
- 'REGEXPS' => array(),
337
- 'ESCAPE_CHAR' => true,
338
- 'BRACKETS' => true,
339
- 'SYMBOLS' => false,
340
- 'STRINGS' => true,
341
- 'NUMBERS' => true,
342
- 'METHODS' => true,
343
- 'SCRIPT' => true
344
- );
345
-
346
- /**
347
- * The time it took to parse the code
348
- * @var double
349
- */
350
- var $time = 0;
351
-
352
- /**
353
- * The content of the header block
354
- * @var string
355
- */
356
- var $header_content = '';
357
-
358
- /**
359
- * The content of the footer block
360
- * @var string
361
- */
362
- var $footer_content = '';
363
-
364
- /**
365
- * The style of the header block
366
- * @var string
367
- */
368
- var $header_content_style = '';
369
-
370
- /**
371
- * The style of the footer block
372
- * @var string
373
- */
374
- var $footer_content_style = '';
375
-
376
- /**
377
- * Tells if a block around the highlighted source should be forced
378
- * if not using line numbering
379
- * @var boolean
380
- */
381
- var $force_code_block = false;
382
-
383
- /**
384
- * The styles for hyperlinks in the code
385
- * @var array
386
- */
387
- var $link_styles = array();
388
-
389
- /**
390
- * Whether important blocks should be recognised or not
391
- * @var boolean
392
- * @deprecated
393
- * @todo REMOVE THIS FUNCTIONALITY!
394
- */
395
- var $enable_important_blocks = false;
396
-
397
- /**
398
- * Styles for important parts of the code
399
- * @var string
400
- * @deprecated
401
- * @todo As above - rethink the whole idea of important blocks as it is buggy and
402
- * will be hard to implement in 1.2
403
- */
404
- var $important_styles = 'font-weight: bold; color: red;'; // Styles for important parts of the code
405
-
406
- /**
407
- * Whether CSS IDs should be added to the code
408
- * @var boolean
409
- */
410
- var $add_ids = false;
411
-
412
- /**
413
- * Lines that should be highlighted extra
414
- * @var array
415
- */
416
- var $highlight_extra_lines = array();
417
-
418
- /**
419
- * Styles of lines that should be highlighted extra
420
- * @var array
421
- */
422
- var $highlight_extra_lines_styles = array();
423
-
424
- /**
425
- * Styles of extra-highlighted lines
426
- * @var string
427
- */
428
- var $highlight_extra_lines_style = 'background-color: #ffc;';
429
-
430
- /**
431
- * The line ending
432
- * If null, nl2br() will be used on the result string.
433
- * Otherwise, all instances of \n will be replaced with $line_ending
434
- * @var string
435
- */
436
- var $line_ending = null;
437
-
438
- /**
439
- * Number at which line numbers should start at
440
- * @var int
441
- */
442
- var $line_numbers_start = 1;
443
-
444
- /**
445
- * The overall style for this code block
446
- * @var string
447
- */
448
- var $overall_style = 'font-family:monospace;';
449
-
450
- /**
451
- * The style for the actual code
452
- * @var string
453
- */
454
- var $code_style = 'font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;';
455
-
456
- /**
457
- * The overall class for this code block
458
- * @var string
459
- */
460
- var $overall_class = '';
461
-
462
- /**
463
- * The overall ID for this code block
464
- * @var string
465
- */
466
- var $overall_id = '';
467
-
468
- /**
469
- * Line number styles
470
- * @var string
471
- */
472
- var $line_style1 = 'font-weight: normal; vertical-align:top;';
473
-
474
- /**
475
- * Line number styles for fancy lines
476
- * @var string
477
- */
478
- var $line_style2 = 'font-weight: bold; vertical-align:top;';
479
-
480
- /**
481
- * Style for line numbers when GESHI_HEADER_PRE_TABLE is chosen
482
- * @var string
483
- */
484
- var $table_linenumber_style = 'width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;';
485
-
486
- /**
487
- * Flag for how line numbers are displayed
488
- * @var boolean
489
- */
490
- var $line_numbers = GESHI_NO_LINE_NUMBERS;
491
-
492
- /**
493
- * Flag to decide if multi line spans are allowed. Set it to false to make sure
494
- * each tag is closed before and reopened after each linefeed.
495
- * @var boolean
496
- */
497
- var $allow_multiline_span = true;
498
-
499
- /**
500
- * The "nth" value for fancy line highlighting
501
- * @var int
502
- */
503
- var $line_nth_row = 0;
504
-
505
- /**
506
- * The size of tab stops
507
- * @var int
508
- */
509
- var $tab_width = 8;
510
-
511
- /**
512
- * Should we use language-defined tab stop widths?
513
- * @var int
514
- */
515
- var $use_language_tab_width = false;
516
-
517
- /**
518
- * Default target for keyword links
519
- * @var string
520
- */
521
- var $link_target = '';
522
-
523
- /**
524
- * The encoding to use for entity encoding
525
- * NOTE: Used with Escape Char Sequences to fix UTF-8 handling (cf. SF#2037598)
526
- * @var string
527
- */
528
- var $encoding = 'utf-8';
529
-
530
- /**
531
- * Should keywords be linked?
532
- * @var boolean
533
- */
534
- var $keyword_links = true;
535
-
536
- /**
537
- * Currently loaded language file
538
- * @var string
539
- * @since 1.0.7.22
540
- */
541
- var $loaded_language = '';
542
-
543
- /**
544
- * Wether the caches needed for parsing are built or not
545
- *
546
- * @var bool
547
- * @since 1.0.8
548
- */
549
- var $parse_cache_built = false;
550
-
551
- /**
552
- * Work around for Suhosin Patch with disabled /e modifier
553
- *
554
- * Note from suhosins author in config file:
555
- * <blockquote>
556
- * The /e modifier inside <code>preg_replace()</code> allows code execution.
557
- * Often it is the cause for remote code execution exploits. It is wise to
558
- * deactivate this feature and test where in the application it is used.
559
- * The developer using the /e modifier should be made aware that he should
560
- * use <code>preg_replace_callback()</code> instead
561
- * </blockquote>
562
- *
563
- * @var array
564
- * @since 1.0.8
565
- */
566
- var $_kw_replace_group = 0;
567
- var $_rx_key = 0;
568
-
569
- /**
570
- * some "callback parameters" for handle_multiline_regexps
571
- *
572
- * @since 1.0.8
573
- * @access private
574
- * @var string
575
- */
576
- var $_hmr_before = '';
577
- var $_hmr_replace = '';
578
- var $_hmr_after = '';
579
- var $_hmr_key = 0;
580
-
581
- /**#@-*/
582
-
583
- /**
584
- * Creates a new GeSHi object, with source and language
585
- *
586
- * @param string The source code to highlight
587
- * @param string The language to highlight the source with
588
- * @param string The path to the language file directory. <b>This
589
- * is deprecated!</b> I've backported the auto path
590
- * detection from the 1.1.X dev branch, so now it
591
- * should be automatically set correctly. If you have
592
- * renamed the language directory however, you will
593
- * still need to set the path using this parameter or
594
- * {@link GeSHi->set_language_path()}
595
- * @since 1.0.0
596
- */
597
- function GeSHi($source = '', $language = '', $path = '') {
598
- if (!empty($source)) {
599
- $this->set_source($source);
600
- }
601
- if (!empty($language)) {
602
- $this->set_language($language);
603
- }
604
- $this->set_language_path($path);
605
- }
606
-
607
- /**
608
- * Returns an error message associated with the last GeSHi operation,
609
- * or false if no error has occured
610
- *
611
- * @return string|false An error message if there has been an error, else false
612
- * @since 1.0.0
613
- */
614
- function error() {
615
- if ($this->error) {
616
- //Put some template variables for debugging here ...
617
- $debug_tpl_vars = array(
618
- '{LANGUAGE}' => $this->language,
619
- '{PATH}' => $this->language_path
620
- );
621
- $msg = str_replace(
622
- array_keys($debug_tpl_vars),
623
- array_values($debug_tpl_vars),
624
- $this->error_messages[$this->error]);
625
-
626
- return "<br /><strong>GeSHi Error:</strong> $msg (code {$this->error})<br />";
627
- }
628
- return false;
629
- }
630
-
631
- /**
632
- * Gets a human-readable language name (thanks to Simon Patterson
633
- * for the idea :))
634
- *
635
- * @return string The name for the current language
636
- * @since 1.0.2
637
- */
638
- function get_language_name() {
639
- if (GESHI_ERROR_NO_SUCH_LANG == $this->error) {
640
- return $this->language_data['LANG_NAME'] . ' (Unknown Language)';
641
- }
642
- return $this->language_data['LANG_NAME'];
643
- }
644
-
645
- /**
646
- * Sets the source code for this object
647
- *
648
- * @param string The source code to highlight
649
- * @since 1.0.0
650
- */
651
- function set_source($source) {
652
- $this->source = $source;
653
- $this->highlight_extra_lines = array();
654
- }
655
-
656
- /**
657
- * Sets the language for this object
658
- *
659
- * @note since 1.0.8 this function won't reset language-settings by default anymore!
660
- * if you need this set $force_reset = true
661
- *
662
- * @param string The name of the language to use
663
- * @since 1.0.0
664
- */
665
- function set_language($language, $force_reset = false) {
666
- if ($force_reset) {
667
- $this->loaded_language = false;
668
- }
669
-
670
- //Clean up the language name to prevent malicious code injection
671
- $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);
672
-
673
- $language = strtolower($language);
674
-
675
- //Retreive the full filename
676
- $file_name = $this->language_path . $language . '.php';
677
- if ($file_name == $this->loaded_language) {
678
- // this language is already loaded!
679
- return;
680
- }
681
-
682
- $this->language = $language;
683
-
684
- $this->error = false;
685
- $this->strict_mode = GESHI_NEVER;
686
-
687
- //Check if we can read the desired file
688
- if (!is_readable($file_name)) {
689
- $this->error = GESHI_ERROR_NO_SUCH_LANG;
690
- return;
691
- }
692
-
693
- // Load the language for parsing
694
- $this->load_language($file_name);
695
- }
696
-
697
- /**
698
- * Sets the path to the directory containing the language files. Note
699
- * that this path is relative to the directory of the script that included
700
- * geshi.php, NOT geshi.php itself.
701
- *
702
- * @param string The path to the language directory
703
- * @since 1.0.0
704
- * @deprecated The path to the language files should now be automatically
705
- * detected, so this method should no longer be needed. The
706
- * 1.1.X branch handles manual setting of the path differently
707
- * so this method will disappear in 1.2.0.
708
- */
709
- function set_language_path($path) {
710
- if(strpos($path,':')) {
711
- //Security Fix to prevent external directories using fopen wrappers.
712
- if(DIRECTORY_SEPARATOR == "\\") {
713
- if(!preg_match('#^[a-zA-Z]:#', $path) || false !== strpos($path, ':', 2)) {
714
- return;
715
- }
716
- } else {
717
- return;
718
- }
719
- }
720
- if(preg_match('#[^/a-zA-Z0-9_\.\-\\\s:]#', $path)) {
721
- //Security Fix to prevent external directories using fopen wrappers.
722
- return;
723
- }
724
- if(GESHI_SECURITY_PARANOID && false !== strpos($path, '/.')) {
725
- //Security Fix to prevent external directories using fopen wrappers.
726
- return;
727
- }
728
- if(GESHI_SECURITY_PARANOID && false !== strpos($path, '..')) {
729
- //Security Fix to prevent external directories using fopen wrappers.
730
- return;
731
- }
732
- if ($path) {
733
- $this->language_path = ('/' == $path[strlen($path) - 1]) ? $path : $path . '/';
734
- $this->set_language($this->language); // otherwise set_language_path has no effect
735
- }
736
- }
737
-
738
- /**
739
- * Get supported langs or an associative array lang=>full_name.
740
- * @param boolean $longnames
741
- * @return array
742
- */
743
- function get_supported_languages($full_names=false)
744
- {
745
- // return array
746
- $back = array();
747
-
748
- // we walk the lang root
749
- $dir = dir($this->language_path);
750
-
751
- // foreach entry
752
- while (false !== ($entry = $dir->read()))
753
- {
754
- $full_path = $this->language_path.$entry;
755
-
756
- // Skip all dirs
757
- if (is_dir($full_path)) {
758
- continue;
759
- }
760
-
761
- // we only want lang.php files
762
- if (!preg_match('/^([^.]+)\.php$/', $entry, $matches)) {
763
- continue;
764
- }
765
-
766
- // Raw lang name is here
767
- $langname = $matches[1];
768
-
769
- // We want the fullname too?
770
- if ($full_names === true)
771
- {
772
- if (false !== ($fullname = $this->get_language_fullname($langname)))
773
- {
774
- $back[$langname] = $fullname; // we go associative
775
- }
776
- }
777
- else
778
- {
779
- // just store raw langname
780
- $back[] = $langname;
781
- }
782
- }
783
-
784
- $dir->close();
785
-
786
- return $back;
787
- }
788
-
789
- /**
790
- * Get full_name for a lang or false.
791
- * @param string $language short langname (html4strict for example)
792
- * @return mixed
793
- */
794
- function get_language_fullname($language)
795
- {
796
- //Clean up the language name to prevent malicious code injection
797
- $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);
798
-
799
- $language = strtolower($language);
800
-
801
- // get fullpath-filename for a langname
802
- $fullpath = $this->language_path.$language.'.php';
803
-
804
- // we need to get contents :S
805
- if (false === ($data = file_get_contents($fullpath))) {
806
- $this->error = sprintf('Geshi::get_lang_fullname() Unknown Language: %s', $language);
807
- return false;
808
- }
809
-
810
- // match the langname
811
- if (!preg_match('/\'LANG_NAME\'\s*=>\s*\'((?:[^\']|\\\')+)\'/', $data, $matches)) {
812
- $this->error = sprintf('Geshi::get_lang_fullname(%s): Regex can not detect language', $language);
813
- return false;
814
- }
815
-
816
- // return fullname for langname
817
- return stripcslashes($matches[1]);
818
- }
819
-
820
- /**
821
- * Sets the type of header to be used.
822
- *
823
- * If GESHI_HEADER_DIV is used, the code is surrounded in a "div".This
824
- * means more source code but more control over tab width and line-wrapping.
825
- * GESHI_HEADER_PRE means that a "pre" is used - less source, but less
826
- * control. Default is GESHI_HEADER_PRE.
827
- *
828
- * From 1.0.7.2, you can use GESHI_HEADER_NONE to specify that no header code
829
- * should be outputted.
830
- *
831
- * @param int The type of header to be used
832
- * @since 1.0.0
833
- */
834
- function set_header_type($type) {
835
- //Check if we got a valid header type
836
- if (!in_array($type, array(GESHI_HEADER_NONE, GESHI_HEADER_DIV,
837
- GESHI_HEADER_PRE, GESHI_HEADER_PRE_VALID, GESHI_HEADER_PRE_TABLE))) {
838
- $this->error = GESHI_ERROR_INVALID_HEADER_TYPE;
839
- return;
840
- }
841
-
842
- //Set that new header type
843
- $this->header_type = $type;
844
- }
845
-
846
- /**
847
- * Sets the styles for the code that will be outputted
848
- * when this object is parsed. The style should be a
849
- * string of valid stylesheet declarations
850
- *
851
- * @param string The overall style for the outputted code block
852
- * @param boolean Whether to merge the styles with the current styles or not
853
- * @since 1.0.0
854
- */
855
- function set_overall_style($style, $preserve_defaults = false) {
856
- if (!$preserve_defaults) {
857
- $this->overall_style = $style;
858
- } else {
859
- $this->overall_style .= $style;
860
- }
861
- }
862
-
863
- /**
864
- * Sets the overall classname for this block of code. This
865
- * class can then be used in a stylesheet to style this object's
866
- * output
867
- *
868
- * @param string The class name to use for this block of code
869
- * @since 1.0.0
870
- */
871
- function set_overall_class($class) {
872
- $this->overall_class = $class;
873
- }
874
-
875
- /**
876
- * Sets the overall id for this block of code. This id can then
877
- * be used in a stylesheet to style this object's output
878
- *
879
- * @param string The ID to use for this block of code
880
- * @since 1.0.0
881
- */
882
- function set_overall_id($id) {
883
- $this->overall_id = $id;
884
- }
885
-
886
- /**
887
- * Sets whether CSS classes should be used to highlight the source. Default
888
- * is off, calling this method with no arguments will turn it on
889
- *
890
- * @param boolean Whether to turn classes on or not
891
- * @since 1.0.0
892
- */
893
- function enable_classes($flag = true) {
894
- $this->use_classes = ($flag) ? true : false;
895
- }
896
-
897
- /**
898
- * Sets the style for the actual code. This should be a string
899
- * containing valid stylesheet declarations. If $preserve_defaults is
900
- * true, then styles are merged with the default styles, with the
901
- * user defined styles having priority
902
- *
903
- * Note: Use this method to override any style changes you made to
904
- * the line numbers if you are using line numbers, else the line of
905
- * code will have the same style as the line number! Consult the
906
- * GeSHi documentation for more information about this.
907
- *
908
- * @param string The style to use for actual code
909
- * @param boolean Whether to merge the current styles with the new styles
910
- * @since 1.0.2
911
- */
912
- function set_code_style($style, $preserve_defaults = false) {
913
- if (!$preserve_defaults) {
914
- $this->code_style = $style;
915
- } else {
916
- $this->code_style .= $style;
917
- }
918
- }
919
-
920
- /**
921
- * Sets the styles for the line numbers.
922
- *
923
- * @param string The style for the line numbers that are "normal"
924
- * @param string|boolean If a string, this is the style of the line
925
- * numbers that are "fancy", otherwise if boolean then this
926
- * defines whether the normal styles should be merged with the
927
- * new normal styles or not
928
- * @param boolean If set, is the flag for whether to merge the "fancy"
929
- * styles with the current styles or not
930
- * @since 1.0.2
931
- */
932
- function set_line_style($style1, $style2 = '', $preserve_defaults = false) {
933
- //Check if we got 2 or three parameters
934
- if (is_bool($style2)) {
935
- $preserve_defaults = $style2;
936
- $style2 = '';
937
- }
938
-
939
- //Actually set the new styles
940
- if (!$preserve_defaults) {
941
- $this->line_style1 = $style1;
942
- $this->line_style2 = $style2;
943
- } else {
944
- $this->line_style1 .= $style1;
945
- $this->line_style2 .= $style2;
946
- }
947
- }
948
-
949
- /**
950
- * Sets whether line numbers should be displayed.
951
- *
952
- * Valid values for the first parameter are:
953
- *
954
- * - GESHI_NO_LINE_NUMBERS: Line numbers will not be displayed
955
- * - GESHI_NORMAL_LINE_NUMBERS: Line numbers will be displayed
956
- * - GESHI_FANCY_LINE_NUMBERS: Fancy line numbers will be displayed
957
- *
958
- * For fancy line numbers, the second parameter is used to signal which lines
959
- * are to be fancy. For example, if the value of this parameter is 5 then every
960
- * 5th line will be fancy.
961
- *
962
- * @param int How line numbers should be displayed
963
- * @param int Defines which lines are fancy
964
- * @since 1.0.0
965
- */
966
- function enable_line_numbers($flag, $nth_row = 5) {
967
- if (GESHI_NO_LINE_NUMBERS != $flag && GESHI_NORMAL_LINE_NUMBERS != $flag
968
- && GESHI_FANCY_LINE_NUMBERS != $flag) {
969
- $this->error = GESHI_ERROR_INVALID_LINE_NUMBER_TYPE;
970
- }
971
- $this->line_numbers = $flag;
972
- $this->line_nth_row = $nth_row;
973
- }
974
-
975
- /**
976
- * Sets wether spans and other HTML markup generated by GeSHi can
977
- * span over multiple lines or not. Defaults to true to reduce overhead.
978
- * Set it to false if you want to manipulate the output or manually display
979
- * the code in an ordered list.
980
- *
981
- * @param boolean Wether multiline spans are allowed or not
982
- * @since 1.0.7.22
983
- */
984
- function enable_multiline_span($flag) {
985
- $this->allow_multiline_span = (bool) $flag;
986
- }
987
-
988
- /**
989
- * Get current setting for multiline spans, see GeSHi->enable_multiline_span().
990
- *
991
- * @see enable_multiline_span
992
- * @return bool
993
- */
994
- function get_multiline_span() {
995
- return $this->allow_multiline_span;
996
- }
997
-
998
- /**
999
- * Sets the style for a keyword group. If $preserve_defaults is
1000
- * true, then styles are merged with the default styles, with the
1001
- * user defined styles having priority
1002
- *
1003
- * @param int The key of the keyword group to change the styles of
1004
- * @param string The style to make the keywords
1005
- * @param boolean Whether to merge the new styles with the old or just
1006
- * to overwrite them
1007
- * @since 1.0.0
1008
- */
1009
- function set_keyword_group_style($key, $style, $preserve_defaults = false) {
1010
- //Set the style for this keyword group
1011
- if (!$preserve_defaults) {
1012
- $this->language_data['STYLES']['KEYWORDS'][$key] = $style;
1013
- } else {
1014
- $this->language_data['STYLES']['KEYWORDS'][$key] .= $style;
1015
- }
1016
-
1017
- //Update the lexic permissions
1018
- if (!isset($this->lexic_permissions['KEYWORDS'][$key])) {
1019
- $this->lexic_permissions['KEYWORDS'][$key] = true;
1020
- }
1021
- }
1022
-
1023
- /**
1024
- * Turns highlighting on/off for a keyword group
1025
- *
1026
- * @param int The key of the keyword group to turn on or off
1027
- * @param boolean Whether to turn highlighting for that group on or off
1028
- * @since 1.0.0
1029
- */
1030
- function set_keyword_group_highlighting($key, $flag = true) {
1031
- $this->lexic_permissions['KEYWORDS'][$key] = ($flag) ? true : false;
1032
- }
1033
-
1034
- /**
1035
- * Sets the styles for comment groups. If $preserve_defaults is
1036
- * true, then styles are merged with the default styles, with the
1037
- * user defined styles having priority
1038
- *
1039
- * @param int The key of the comment group to change the styles of
1040
- * @param string The style to make the comments
1041
- * @param boolean Whether to merge the new styles with the old or just
1042
- * to overwrite them
1043
- * @since 1.0.0
1044
- */
1045
- function set_comments_style($key, $style, $preserve_defaults = false) {
1046
- if (!$preserve_defaults) {
1047
- $this->language_data['STYLES']['COMMENTS'][$key] = $style;
1048
- } else {
1049
- $this->language_data['STYLES']['COMMENTS'][$key] .= $style;
1050
- }
1051
- }
1052
-
1053
- /**
1054
- * Turns highlighting on/off for comment groups
1055
- *
1056
- * @param int The key of the comment group to turn on or off
1057
- * @param boolean Whether to turn highlighting for that group on or off
1058
- * @since 1.0.0
1059
- */
1060
- function set_comments_highlighting($key, $flag = true) {
1061
- $this->lexic_permissions['COMMENTS'][$key] = ($flag) ? true : false;
1062
- }
1063
-
1064
- /**
1065
- * Sets the styles for escaped characters. If $preserve_defaults is
1066
- * true, then styles are merged with the default styles, with the
1067
- * user defined styles having priority
1068
- *
1069
- * @param string The style to make the escape characters
1070
- * @param boolean Whether to merge the new styles with the old or just
1071
- * to overwrite them
1072
- * @since 1.0.0
1073
- */
1074
- function set_escape_characters_style($style, $preserve_defaults = false, $group = 0) {
1075
- if (!$preserve_defaults) {
1076
- $this->language_data['STYLES']['ESCAPE_CHAR'][$group] = $style;
1077
- } else {
1078
- $this->language_data['STYLES']['ESCAPE_CHAR'][$group] .= $style;
1079
- }
1080
- }
1081
-
1082
- /**
1083
- * Turns highlighting on/off for escaped characters
1084
- *
1085
- * @param boolean Whether to turn highlighting for escape characters on or off
1086
- * @since 1.0.0
1087
- */
1088
- function set_escape_characters_highlighting($flag = true) {
1089
- $this->lexic_permissions['ESCAPE_CHAR'] = ($flag) ? true : false;
1090
- }
1091
-
1092
- /**
1093
- * Sets the styles for brackets. If $preserve_defaults is
1094
- * true, then styles are merged with the default styles, with the
1095
- * user defined styles having priority
1096
- *
1097
- * This method is DEPRECATED: use set_symbols_style instead.
1098
- * This method will be removed in 1.2.X
1099
- *
1100
- * @param string The style to make the brackets
1101
- * @param boolean Whether to merge the new styles with the old or just
1102
- * to overwrite them
1103
- * @since 1.0.0
1104
- * @deprecated In favour of set_symbols_style
1105
- */
1106
- function set_brackets_style($style, $preserve_defaults = false) {
1107
- if (!$preserve_defaults) {
1108
- $this->language_data['STYLES']['BRACKETS'][0] = $style;
1109
- } else {
1110
- $this->language_data['STYLES']['BRACKETS'][0] .= $style;
1111
- }
1112
- }
1113
-
1114
- /**
1115
- * Turns highlighting on/off for brackets
1116
- *
1117
- * This method is DEPRECATED: use set_symbols_highlighting instead.
1118
- * This method will be remove in 1.2.X
1119
- *
1120
- * @param boolean Whether to turn highlighting for brackets on or off
1121
- * @since 1.0.0
1122
- * @deprecated In favour of set_symbols_highlighting
1123
- */
1124
- function set_brackets_highlighting($flag) {
1125
- $this->lexic_permissions['BRACKETS'] = ($flag) ? true : false;
1126
- }
1127
-
1128
- /**
1129
- * Sets the styles for symbols. If $preserve_defaults is
1130
- * true, then styles are merged with the default styles, with the
1131
- * user defined styles having priority
1132
- *
1133
- * @param string The style to make the symbols
1134
- * @param boolean Whether to merge the new styles with the old or just
1135
- * to overwrite them
1136
- * @param int Tells the group of symbols for which style should be set.
1137
- * @since 1.0.1
1138
- */
1139
- function set_symbols_style($style, $preserve_defaults = false, $group = 0) {
1140
- // Update the style of symbols
1141
- if (!$preserve_defaults) {
1142
- $this->language_data['STYLES']['SYMBOLS'][$group] = $style;
1143
- } else {
1144
- $this->language_data['STYLES']['SYMBOLS'][$group] .= $style;
1145
- }
1146
-
1147
- // For backward compatibility
1148
- if (0 == $group) {
1149
- $this->set_brackets_style ($style, $preserve_defaults);
1150
- }
1151
- }
1152
-
1153
- /**
1154
- * Turns highlighting on/off for symbols
1155
- *
1156
- * @param boolean Whether to turn highlighting for symbols on or off
1157
- * @since 1.0.0
1158
- */
1159
- function set_symbols_highlighting($flag) {
1160
- // Update lexic permissions for this symbol group
1161
- $this->lexic_permissions['SYMBOLS'] = ($flag) ? true : false;
1162
-
1163
- // For backward compatibility
1164
- $this->set_brackets_highlighting ($flag);
1165
- }
1166
-
1167
- /**
1168
- * Sets the styles for strings. If $preserve_defaults is
1169
- * true, then styles are merged with the default styles, with the
1170
- * user defined styles having priority
1171
- *
1172
- * @param string The style to make the escape characters
1173
- * @param boolean Whether to merge the new styles with the old or just
1174
- * to overwrite them
1175
- * @param int Tells the group of strings for which style should be set.
1176
- * @since 1.0.0
1177
- */
1178
- function set_strings_style($style, $preserve_defaults = false, $group = 0) {
1179
- if (!$preserve_defaults) {
1180
- $this->language_data['STYLES']['STRINGS'][$group] = $style;
1181
- } else {
1182
- $this->language_data['STYLES']['STRINGS'][$group] .= $style;
1183
- }
1184
- }
1185
-
1186
- /**
1187
- * Turns highlighting on/off for strings
1188
- *
1189
- * @param boolean Whether to turn highlighting for strings on or off
1190
- * @since 1.0.0
1191
- */
1192
- function set_strings_highlighting($flag) {
1193
- $this->lexic_permissions['STRINGS'] = ($flag) ? true : false;
1194
- }
1195
-
1196
- /**
1197
- * Sets the styles for strict code blocks. If $preserve_defaults is
1198
- * true, then styles are merged with the default styles, with the
1199
- * user defined styles having priority
1200
- *
1201
- * @param string The style to make the script blocks
1202
- * @param boolean Whether to merge the new styles with the old or just
1203
- * to overwrite them
1204
- * @param int Tells the group of script blocks for which style should be set.
1205
- * @since 1.0.8.4
1206
- */
1207
- function set_script_style($style, $preserve_defaults = false, $group = 0) {
1208
- // Update the style of symbols
1209
- if (!$preserve_defaults) {
1210
- $this->language_data['STYLES']['SCRIPT'][$group] = $style;
1211
- } else {
1212
- $this->language_data['STYLES']['SCRIPT'][$group] .= $style;
1213
- }
1214
- }
1215
-
1216
- /**
1217
- * Sets the styles for numbers. If $preserve_defaults is
1218
- * true, then styles are merged with the default styles, with the
1219
- * user defined styles having priority
1220
- *
1221
- * @param string The style to make the numbers
1222
- * @param boolean Whether to merge the new styles with the old or just
1223
- * to overwrite them
1224
- * @param int Tells the group of numbers for which style should be set.
1225
- * @since 1.0.0
1226
- */
1227
- function set_numbers_style($style, $preserve_defaults = false, $group = 0) {
1228
- if (!$preserve_defaults) {
1229
- $this->language_data['STYLES']['NUMBERS'][$group] = $style;
1230
- } else {
1231
- $this->language_data['STYLES']['NUMBERS'][$group] .= $style;
1232
- }
1233
- }
1234
-
1235
- /**
1236
- * Turns highlighting on/off for numbers
1237
- *
1238
- * @param boolean Whether to turn highlighting for numbers on or off
1239
- * @since 1.0.0
1240
- */
1241
- function set_numbers_highlighting($flag) {
1242
- $this->lexic_permissions['NUMBERS'] = ($flag) ? true : false;
1243
- }
1244
-
1245
- /**
1246
- * Sets the styles for methods. $key is a number that references the
1247
- * appropriate "object splitter" - see the language file for the language
1248
- * you are highlighting to get this number. If $preserve_defaults is
1249
- * true, then styles are merged with the default styles, with the
1250
- * user defined styles having priority
1251
- *
1252
- * @param int The key of the object splitter to change the styles of
1253
- * @param string The style to make the methods
1254
- * @param boolean Whether to merge the new styles with the old or just
1255
- * to overwrite them
1256
- * @since 1.0.0
1257
- */
1258
- function set_methods_style($key, $style, $preserve_defaults = false) {
1259
- if (!$preserve_defaults) {
1260
- $this->language_data['STYLES']['METHODS'][$key] = $style;
1261
- } else {
1262
- $this->language_data['STYLES']['METHODS'][$key] .= $style;
1263
- }
1264
- }
1265
-
1266
- /**
1267
- * Turns highlighting on/off for methods
1268
- *
1269
- * @param boolean Whether to turn highlighting for methods on or off
1270
- * @since 1.0.0
1271
- */
1272
- function set_methods_highlighting($flag) {
1273
- $this->lexic_permissions['METHODS'] = ($flag) ? true : false;
1274
- }
1275
-
1276
- /**
1277
- * Sets the styles for regexps. If $preserve_defaults is
1278
- * true, then styles are merged with the default styles, with the
1279
- * user defined styles having priority
1280
- *
1281
- * @param string The style to make the regular expression matches
1282
- * @param boolean Whether to merge the new styles with the old or just
1283
- * to overwrite them
1284
- * @since 1.0.0
1285
- */
1286
- function set_regexps_style($key, $style, $preserve_defaults = false) {
1287
- if (!$preserve_defaults) {
1288
- $this->language_data['STYLES']['REGEXPS'][$key] = $style;
1289
- } else {
1290
- $this->language_data['STYLES']['REGEXPS'][$key] .= $style;
1291
- }
1292
- }
1293
-
1294
- /**
1295
- * Turns highlighting on/off for regexps
1296
- *
1297
- * @param int The key of the regular expression group to turn on or off
1298
- * @param boolean Whether to turn highlighting for the regular expression group on or off
1299
- * @since 1.0.0
1300
- */
1301
- function set_regexps_highlighting($key, $flag) {
1302
- $this->lexic_permissions['REGEXPS'][$key] = ($flag) ? true : false;
1303
- }
1304
-
1305
- /**
1306
- * Sets whether a set of keywords are checked for in a case sensitive manner
1307
- *
1308
- * @param int The key of the keyword group to change the case sensitivity of
1309
- * @param boolean Whether to check in a case sensitive manner or not
1310
- * @since 1.0.0
1311
- */
1312
- function set_case_sensitivity($key, $case) {
1313
- $this->language_data['CASE_SENSITIVE'][$key] = ($case) ? true : false;
1314
- }
1315
-
1316
- /**
1317
- * Sets the case that keywords should use when found. Use the constants:
1318
- *
1319
- * - GESHI_CAPS_NO_CHANGE: leave keywords as-is
1320
- * - GESHI_CAPS_UPPER: convert all keywords to uppercase where found
1321
- * - GESHI_CAPS_LOWER: convert all keywords to lowercase where found
1322
- *
1323
- * @param int A constant specifying what to do with matched keywords
1324
- * @since 1.0.1
1325
- */
1326
- function set_case_keywords($case) {
1327
- if (in_array($case, array(
1328
- GESHI_CAPS_NO_CHANGE, GESHI_CAPS_UPPER, GESHI_CAPS_LOWER))) {
1329
- $this->language_data['CASE_KEYWORDS'] = $case;
1330
- }
1331
- }
1332
-
1333
- /**
1334
- * Sets how many spaces a tab is substituted for
1335
- *
1336
- * Widths below zero are ignored
1337
- *
1338
- * @param int The tab width
1339
- * @since 1.0.0
1340
- */
1341
- function set_tab_width($width) {
1342
- $this->tab_width = intval($width);
1343
-
1344
- //Check if it fit's the constraints:
1345
- if ($this->tab_width < 1) {
1346
- //Return it to the default
1347
- $this->tab_width = 8;
1348
- }
1349
- }
1350
-
1351
- /**
1352
- * Sets whether or not to use tab-stop width specifed by language
1353
- *
1354
- * @param boolean Whether to use language-specific tab-stop widths
1355
- * @since 1.0.7.20
1356
- */
1357
- function set_use_language_tab_width($use) {
1358
- $this->use_language_tab_width = (bool) $use;
1359
- }
1360
-
1361
- /**
1362
- * Returns the tab width to use, based on the current language and user
1363
- * preference
1364
- *
1365
- * @return int Tab width
1366
- * @since 1.0.7.20
1367
- */
1368
- function get_real_tab_width() {
1369
- if (!$this->use_language_tab_width ||
1370
- !isset($this->language_data['TAB_WIDTH'])) {
1371
- return $this->tab_width;
1372
- } else {
1373
- return $this->language_data['TAB_WIDTH'];
1374
- }
1375
- }
1376
-
1377
- /**
1378
- * Enables/disables strict highlighting. Default is off, calling this
1379
- * method without parameters will turn it on. See documentation
1380
- * for more details on strict mode and where to use it.
1381
- *
1382
- * @param boolean Whether to enable strict mode or not
1383
- * @since 1.0.0
1384
- */
1385
- function enable_strict_mode($mode = true) {
1386
- if (GESHI_MAYBE == $this->language_data['STRICT_MODE_APPLIES']) {
1387
- $this->strict_mode = ($mode) ? GESHI_ALWAYS : GESHI_NEVER;
1388
- }
1389
- }
1390
-
1391
- /**
1392
- * Disables all highlighting
1393
- *
1394
- * @since 1.0.0
1395
- * @todo Rewrite with array traversal
1396
- * @deprecated In favour of enable_highlighting
1397
- */
1398
- function disable_highlighting() {
1399
- $this->enable_highlighting(false);
1400
- }
1401
-
1402
- /**
1403
- * Enables all highlighting
1404
- *
1405
- * The optional flag parameter was added in version 1.0.7.21 and can be used
1406
- * to enable (true) or disable (false) all highlighting.
1407
- *
1408
- * @since 1.0.0
1409
- * @param boolean A flag specifying whether to enable or disable all highlighting
1410
- * @todo Rewrite with array traversal
1411
- */
1412
- function enable_highlighting($flag = true) {
1413
- $flag = $flag ? true : false;
1414
- foreach ($this->lexic_permissions as $key => $value) {
1415
- if (is_array($value)) {
1416
- foreach ($value as $k => $v) {
1417
- $this->lexic_permissions[$key][$k] = $flag;
1418
- }
1419
- } else {
1420
- $this->lexic_permissions[$key] = $flag;
1421
- }
1422
- }
1423
-
1424
- // Context blocks
1425
- $this->enable_important_blocks = $flag;
1426
- }
1427
-
1428
- /**
1429
- * Given a file extension, this method returns either a valid geshi language
1430
- * name, or the empty string if it couldn't be found
1431
- *
1432
- * @param string The extension to get a language name for
1433
- * @param array A lookup array to use instead of the default one
1434
- * @since 1.0.5
1435
- * @todo Re-think about how this method works (maybe make it private and/or make it
1436
- * a extension->lang lookup?)
1437
- * @todo static?
1438
- */
1439
- function get_language_name_from_extension( $extension, $lookup = array() ) {
1440
- if ( !is_array($lookup) || empty($lookup)) {
1441
- $lookup = array(
1442
- '6502acme' => array( 'a', 's', 'asm', 'inc' ),
1443
- '6502tasm' => array( 'a', 's', 'asm', 'inc' ),
1444
- '6502kickass' => array( 'a', 's', 'asm', 'inc' ),
1445
- '68000devpac' => array( 'a', 's', 'asm', 'inc' ),
1446
- 'abap' => array('abap'),
1447
- 'actionscript' => array('as'),
1448
- 'ada' => array('a', 'ada', 'adb', 'ads'),
1449
- 'apache' => array('conf'),
1450
- 'asm' => array('ash', 'asm', 'inc'),
1451
- 'asp' => array('asp'),
1452
- 'bash' => array('sh'),
1453
- 'bf' => array('bf'),
1454
- 'c' => array('c', 'h'),
1455
- 'c_mac' => array('c', 'h'),
1456
- 'caddcl' => array(),
1457
- 'cadlisp' => array(),
1458
- 'cdfg' => array('cdfg'),
1459
- 'cobol' => array('cbl'),
1460
- 'cpp' => array('cpp', 'hpp', 'C', 'H', 'CPP', 'HPP'),
1461
- 'csharp' => array('cs'),
1462
- 'css' => array('css'),
1463
- 'd' => array('d'),
1464
- 'delphi' => array('dpk', 'dpr', 'pp', 'pas'),
1465
- 'diff' => array('diff', 'patch'),
1466
- 'dos' => array('bat', 'cmd'),
1467
- 'gdb' => array('kcrash', 'crash', 'bt'),
1468
- 'gettext' => array('po', 'pot'),
1469
- 'gml' => array('gml'),
1470
- 'gnuplot' => array('plt'),
1471
- 'groovy' => array('groovy'),
1472
- 'haskell' => array('hs'),
1473
- 'html4strict' => array('html', 'htm'),
1474
- 'ini' => array('ini', 'desktop'),
1475
- 'java' => array('java'),
1476
- 'javascript' => array('js'),
1477
- 'klonec' => array('kl1'),
1478
- 'klonecpp' => array('klx'),
1479
- 'latex' => array('tex'),
1480
- 'lisp' => array('lisp'),
1481
- 'lua' => array('lua'),
1482
- 'matlab' => array('m'),
1483
- 'mpasm' => array(),
1484
- 'mysql' => array('sql'),
1485
- 'nsis' => array(),
1486
- 'objc' => array(),
1487
- 'oobas' => array(),
1488
- 'oracle8' => array(),
1489
- 'oracle10' => array(),
1490
- 'pascal' => array('pas'),
1491
- 'perl' => array('pl', 'pm'),
1492
- 'php' => array('php', 'php5', 'phtml', 'phps'),
1493
- 'povray' => array('pov'),
1494
- 'providex' => array('pvc', 'pvx'),
1495
- 'prolog' => array('pl'),
1496
- 'python' => array('py'),
1497
- 'qbasic' => array('bi'),
1498
- 'reg' => array('reg'),
1499
- 'ruby' => array('rb'),
1500
- 'sas' => array('sas'),
1501
- 'scala' => array('scala'),
1502
- 'scheme' => array('scm'),
1503
- 'scilab' => array('sci'),
1504
- 'smalltalk' => array('st'),
1505
- 'smarty' => array(),
1506
- 'tcl' => array('tcl'),
1507
- 'vb' => array('bas'),
1508
- 'vbnet' => array(),
1509
- 'visualfoxpro' => array(),
1510
- 'whitespace' => array('ws'),
1511
- 'xml' => array('xml', 'svg', 'xrc'),
1512
- 'z80' => array('z80', 'asm', 'inc')
1513
- );
1514
- }
1515
-
1516
- foreach ($lookup as $lang => $extensions) {
1517
- if (in_array($extension, $extensions)) {
1518
- return $lang;
1519
- }
1520
- }
1521
- return '';
1522
- }
1523
-
1524
- /**
1525
- * Given a file name, this method loads its contents in, and attempts
1526
- * to set the language automatically. An optional lookup table can be
1527
- * passed for looking up the language name. If not specified a default
1528
- * table is used
1529
- *
1530
- * The language table is in the form
1531
- * <pre>array(
1532
- * 'lang_name' => array('extension', 'extension', ...),
1533
- * 'lang_name' ...
1534
- * );</pre>
1535
- *
1536
- * @param string The filename to load the source from
1537
- * @param array A lookup array to use instead of the default one
1538
- * @todo Complete rethink of this and above method
1539
- * @since 1.0.5
1540
- */
1541
- function load_from_file($file_name, $lookup = array()) {
1542
- if (is_readable($file_name)) {
1543
- $this->set_source(file_get_contents($file_name));
1544
- $this->set_language($this->get_language_name_from_extension(substr(strrchr($file_name, '.'), 1), $lookup));
1545
- } else {
1546
- $this->error = GESHI_ERROR_FILE_NOT_READABLE;
1547
- }
1548
- }
1549
-
1550
- /**
1551
- * Adds a keyword to a keyword group for highlighting
1552
- *
1553
- * @param int The key of the keyword group to add the keyword to
1554
- * @param string The word to add to the keyword group
1555
- * @since 1.0.0
1556
- */
1557
- function add_keyword($key, $word) {
1558
- if (!in_array($word, $this->language_data['KEYWORDS'][$key])) {
1559
- $this->language_data['KEYWORDS'][$key][] = $word;
1560
-
1561
- //NEW in 1.0.8 don't recompile the whole optimized regexp, simply append it
1562
- if ($this->parse_cache_built) {
1563
- $subkey = count($this->language_data['CACHED_KEYWORD_LISTS'][$key]) - 1;
1564
- $this->language_data['CACHED_KEYWORD_LISTS'][$key][$subkey] .= '|' . preg_quote($word, '/');
1565
- }
1566
- }
1567
- }
1568
-
1569
- /**
1570
- * Removes a keyword from a keyword group
1571
- *
1572
- * @param int The key of the keyword group to remove the keyword from
1573
- * @param string The word to remove from the keyword group
1574
- * @param bool Wether to automatically recompile the optimized regexp list or not.
1575
- * Note: if you set this to false and @see GeSHi->parse_code() was already called once,
1576
- * for the current language, you have to manually call @see GeSHi->optimize_keyword_group()
1577
- * or the removed keyword will stay in cache and still be highlighted! On the other hand
1578
- * it might be too expensive to recompile the regexp list for every removal if you want to
1579
- * remove a lot of keywords.
1580
- * @since 1.0.0
1581
- */
1582
- function remove_keyword($key, $word, $recompile = true) {
1583
- $key_to_remove = array_search($word, $this->language_data['KEYWORDS'][$key]);
1584
- if ($key_to_remove !== false) {
1585
- unset($this->language_data['KEYWORDS'][$key][$key_to_remove]);
1586
-
1587
- //NEW in 1.0.8, optionally recompile keyword group
1588
- if ($recompile && $this->parse_cache_built) {
1589
- $this->optimize_keyword_group($key);
1590
- }
1591
- }
1592
- }
1593
-
1594
- /**
1595
- * Creates a new keyword group
1596
- *
1597
- * @param int The key of the keyword group to create
1598
- * @param string The styles for the keyword group
1599
- * @param boolean Whether the keyword group is case sensitive ornot
1600
- * @param array The words to use for the keyword group
1601
- * @since 1.0.0
1602
- */
1603
- function add_keyword_group($key, $styles, $case_sensitive = true, $words = array()) {
1604
- $words = (array) $words;
1605
- if (empty($words)) {
1606
- // empty word lists mess up highlighting
1607
- return false;
1608
- }
1609
-
1610
- //Add the new keyword group internally
1611
- $this->language_data['KEYWORDS'][$key] = $words;
1612
- $this->lexic_permissions['KEYWORDS'][$key] = true;
1613
- $this->language_data['CASE_SENSITIVE'][$key] = $case_sensitive;
1614
- $this->language_data['STYLES']['KEYWORDS'][$key] = $styles;
1615
-
1616
- //NEW in 1.0.8, cache keyword regexp
1617
- if ($this->parse_cache_built) {
1618
- $this->optimize_keyword_group($key);
1619
- }
1620
- }
1621
-
1622
- /**
1623
- * Removes a keyword group
1624
- *
1625
- * @param int The key of the keyword group to remove
1626
- * @since 1.0.0
1627
- */
1628
- function remove_keyword_group ($key) {
1629
- //Remove the keyword group internally
1630
- unset($this->language_data['KEYWORDS'][$key]);
1631
- unset($this->lexic_permissions['KEYWORDS'][$key]);
1632
- unset($this->language_data['CASE_SENSITIVE'][$key]);
1633
- unset($this->language_data['STYLES']['KEYWORDS'][$key]);
1634
-
1635
- //NEW in 1.0.8
1636
- unset($this->language_data['CACHED_KEYWORD_LISTS'][$key]);
1637
- }
1638
-
1639
- /**
1640
- * compile optimized regexp list for keyword group
1641
- *
1642
- * @param int The key of the keyword group to compile & optimize
1643
- * @since 1.0.8
1644
- */
1645
- function optimize_keyword_group($key) {
1646
- $this->language_data['CACHED_KEYWORD_LISTS'][$key] =
1647
- $this->optimize_regexp_list($this->language_data['KEYWORDS'][$key]);
1648
- $space_as_whitespace = false;
1649
- if(isset($this->language_data['PARSER_CONTROL'])) {
1650
- if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'])) {
1651
- if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['SPACE_AS_WHITESPACE'])) {
1652
- $space_as_whitespace = $this->language_data['PARSER_CONTROL']['KEYWORDS']['SPACE_AS_WHITESPACE'];
1653
- }
1654
- if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) {
1655
- if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) {
1656
- $space_as_whitespace = $this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'];
1657
- }
1658
- }
1659
- }
1660
- }
1661
- if($space_as_whitespace) {
1662
- foreach($this->language_data['CACHED_KEYWORD_LISTS'][$key] as $rxk => $rxv) {
1663
- $this->language_data['CACHED_KEYWORD_LISTS'][$key][$rxk] =
1664
- str_replace(" ", "\\s+", $rxv);
1665
- }
1666
- }
1667
- }
1668
-
1669
- /**
1670
- * Sets the content of the header block
1671
- *
1672
- * @param string The content of the header block
1673
- * @since 1.0.2
1674
- */
1675
- function set_header_content($content) {
1676
- $this->header_content = $content;
1677
- }
1678
-
1679
- /**
1680
- * Sets the content of the footer block
1681
- *
1682
- * @param string The content of the footer block
1683
- * @since 1.0.2
1684
- */
1685
- function set_footer_content($content) {
1686
- $this->footer_content = $content;
1687
- }
1688
-
1689
- /**
1690
- * Sets the style for the header content
1691
- *
1692
- * @param string The style for the header content
1693
- * @since 1.0.2
1694
- */
1695
- function set_header_content_style($style) {
1696
- $this->header_content_style = $style;
1697
- }
1698
-
1699
- /**
1700
- * Sets the style for the footer content
1701
- *
1702
- * @param string The style for the footer content
1703
- * @since 1.0.2
1704
- */
1705
- function set_footer_content_style($style) {
1706
- $this->footer_content_style = $style;
1707
- }
1708
-
1709
- /**
1710
- * Sets whether to force a surrounding block around
1711
- * the highlighted code or not
1712
- *
1713
- * @param boolean Tells whether to enable or disable this feature
1714
- * @since 1.0.7.20
1715
- */
1716
- function enable_inner_code_block($flag) {
1717
- $this->force_code_block = (bool)$flag;
1718
- }
1719
-
1720
- /**
1721
- * Sets the base URL to be used for keywords
1722
- *
1723
- * @param int The key of the keyword group to set the URL for
1724
- * @param string The URL to set for the group. If {FNAME} is in
1725
- * the url somewhere, it is replaced by the keyword
1726
- * that the URL is being made for
1727
- * @since 1.0.2
1728
- */
1729
- function set_url_for_keyword_group($group, $url) {
1730
- $this->language_data['URLS'][$group] = $url;
1731
- }
1732
-
1733
- /**
1734
- * Sets styles for links in code
1735
- *
1736
- * @param int A constant that specifies what state the style is being
1737
- * set for - e.g. :hover or :visited
1738
- * @param string The styles to use for that state
1739
- * @since 1.0.2
1740
- */
1741
- function set_link_styles($type, $styles) {
1742
- $this->link_styles[$type] = $styles;
1743
- }
1744
-
1745
- /**
1746
- * Sets the target for links in code
1747
- *
1748
- * @param string The target for links in the code, e.g. _blank
1749
- * @since 1.0.3
1750
- */
1751
- function set_link_target($target) {
1752
- if (!$target) {
1753
- $this->link_target = '';
1754
- } else {
1755
- $this->link_target = ' target="' . $target . '"';
1756
- }
1757
- }
1758
-
1759
- /**
1760
- * Sets styles for important parts of the code
1761
- *
1762
- * @param string The styles to use on important parts of the code
1763
- * @since 1.0.2
1764
- */
1765
- function set_important_styles($styles) {
1766
- $this->important_styles = $styles;
1767
- }
1768
-
1769
- /**
1770
- * Sets whether context-important blocks are highlighted
1771
- *
1772
- * @param boolean Tells whether to enable or disable highlighting of important blocks
1773
- * @todo REMOVE THIS SHIZ FROM GESHI!
1774
- * @deprecated
1775
- * @since 1.0.2
1776
- */
1777
- function enable_important_blocks($flag) {
1778
- $this->enable_important_blocks = ( $flag ) ? true : false;
1779
- }
1780
-
1781
- /**
1782
- * Whether CSS IDs should be added to each line
1783
- *
1784
- * @param boolean If true, IDs will be added to each line.
1785
- * @since 1.0.2
1786
- */
1787
- function enable_ids($flag = true) {
1788
- $this->add_ids = ($flag) ? true : false;
1789
- }
1790
-
1791
- /**
1792
- * Specifies which lines to highlight extra
1793
- *
1794
- * The extra style parameter was added in 1.0.7.21.
1795
- *
1796
- * @param mixed An array of line numbers to highlight, or just a line
1797
- * number on its own.
1798
- * @param string A string specifying the style to use for this line.
1799
- * If null is specified, the default style is used.
1800
- * If false is specified, the line will be removed from
1801
- * special highlighting
1802
- * @since 1.0.2
1803
- * @todo Some data replication here that could be cut down on
1804
- */
1805
- function highlight_lines_extra($lines, $style = null) {
1806
- if (is_array($lines)) {
1807
- //Split up the job using single lines at a time
1808
- foreach ($lines as $line) {
1809
- $this->highlight_lines_extra($line, $style);
1810
- }
1811
- } else {
1812
- //Mark the line as being highlighted specially
1813
- $lines = intval($lines);
1814
- $this->highlight_extra_lines[$lines] = $lines;
1815
-
1816
- //Decide on which style to use
1817
- if ($style === null) { //Check if we should use default style
1818
- unset($this->highlight_extra_lines_styles[$lines]);
1819
- } else if ($style === false) { //Check if to remove this line
1820
- unset($this->highlight_extra_lines[$lines]);
1821
- unset($this->highlight_extra_lines_styles[$lines]);
1822
- } else {
1823
- $this->highlight_extra_lines_styles[$lines] = $style;
1824
- }
1825
- }
1826
- }
1827
-
1828
- /**
1829
- * Sets the style for extra-highlighted lines
1830
- *
1831
- * @param string The style for extra-highlighted lines
1832
- * @since 1.0.2
1833
- */
1834
- function set_highlight_lines_extra_style($styles) {
1835
- $this->highlight_extra_lines_style = $styles;
1836
- }
1837
-
1838
- /**
1839
- * Sets the line-ending
1840
- *
1841
- * @param string The new line-ending
1842
- * @since 1.0.2
1843
- */
1844
- function set_line_ending($line_ending) {
1845
- $this->line_ending = (string)$line_ending;
1846
- }
1847
-
1848
- /**
1849
- * Sets what number line numbers should start at. Should
1850
- * be a positive integer, and will be converted to one.
1851
- *
1852
- * <b>Warning:</b> Using this method will add the "start"
1853
- * attribute to the &lt;ol&gt; that is used for line numbering.
1854
- * This is <b>not</b> valid XHTML strict, so if that's what you
1855
- * care about then don't use this method. Firefox is getting
1856
- * support for the CSS method of doing this in 1.1 and Opera
1857
- * has support for the CSS method, but (of course) IE doesn't
1858
- * so it's not worth doing it the CSS way yet.
1859
- *
1860
- * @param int The number to start line numbers at
1861
- * @since 1.0.2
1862
- */
1863
- function start_line_numbers_at($number) {
1864
- $this->line_numbers_start = abs(intval($number));
1865
- }
1866
-
1867
- /**
1868
- * Sets the encoding used for htmlspecialchars(), for international
1869
- * support.
1870
- *
1871
- * NOTE: This is not needed for now because htmlspecialchars() is not
1872
- * being used (it has a security hole in PHP4 that has not been patched).
1873
- * Maybe in a future version it may make a return for speed reasons, but
1874
- * I doubt it.
1875
- *
1876
- * @param string The encoding to use for the source
1877
- * @since 1.0.3
1878
- */
1879
- function set_encoding($encoding) {
1880
- if ($encoding) {
1881
- $this->encoding = strtolower($encoding);
1882
- }
1883
- }
1884
-
1885
- /**
1886
- * Turns linking of keywords on or off.
1887
- *
1888
- * @param boolean If true, links will be added to keywords
1889
- * @since 1.0.2
1890
- */
1891
- function enable_keyword_links($enable = true) {
1892
- $this->keyword_links = (bool) $enable;
1893
- }
1894
-
1895
- /**
1896
- * Setup caches needed for styling. This is automatically called in
1897
- * parse_code() and get_stylesheet() when appropriate. This function helps
1898
- * stylesheet generators as they rely on some style information being
1899
- * preprocessed
1900
- *
1901
- * @since 1.0.8
1902
- * @access private
1903
- */
1904
- function build_style_cache() {
1905
- //Build the style cache needed to highlight numbers appropriate
1906
- if($this->lexic_permissions['NUMBERS']) {
1907
- //First check what way highlighting information for numbers are given
1908
- if(!isset($this->language_data['NUMBERS'])) {
1909
- $this->language_data['NUMBERS'] = 0;
1910
- }
1911
-
1912
- if(is_array($this->language_data['NUMBERS'])) {
1913
- $this->language_data['NUMBERS_CACHE'] = $this->language_data['NUMBERS'];
1914
- } else {
1915
- $this->language_data['NUMBERS_CACHE'] = array();
1916
- if(!$this->language_data['NUMBERS']) {
1917
- $this->language_data['NUMBERS'] =
1918
- GESHI_NUMBER_INT_BASIC |
1919
- GESHI_NUMBER_FLT_NONSCI;
1920
- }
1921
-
1922
- for($i = 0, $j = $this->language_data['NUMBERS']; $j > 0; ++$i, $j>>=1) {
1923
- //Rearrange style indices if required ...
1924
- if(isset($this->language_data['STYLES']['NUMBERS'][1<<$i])) {
1925
- $this->language_data['STYLES']['NUMBERS'][$i] =
1926
- $this->language_data['STYLES']['NUMBERS'][1<<$i];
1927
- unset($this->language_data['STYLES']['NUMBERS'][1<<$i]);
1928
- }
1929
-
1930
- //Check if this bit is set for highlighting
1931
- if($j&1) {
1932
- //So this bit is set ...
1933
- //Check if it belongs to group 0 or the actual stylegroup
1934
- if(isset($this->language_data['STYLES']['NUMBERS'][$i])) {
1935
- $this->language_data['NUMBERS_CACHE'][$i] = 1 << $i;
1936
- } else {
1937
- if(!isset($this->language_data['NUMBERS_CACHE'][0])) {
1938
- $this->language_data['NUMBERS_CACHE'][0] = 0;
1939
- }
1940
- $this->language_data['NUMBERS_CACHE'][0] |= 1 << $i;
1941
- }
1942
- }
1943
- }
1944
- }
1945
- }
1946
- }
1947
-
1948
- /**
1949
- * Setup caches needed for parsing. This is automatically called in parse_code() when appropriate.
1950
- * This function makes stylesheet generators much faster as they do not need these caches.
1951
- *
1952
- * @since 1.0.8
1953
- * @access private
1954
- */
1955
- function build_parse_cache() {
1956
- // cache symbol regexp
1957
- //As this is a costy operation, we avoid doing it for multiple groups ...
1958
- //Instead we perform it for all symbols at once.
1959
- //
1960
- //For this to work, we need to reorganize the data arrays.
1961
- if ($this->lexic_permissions['SYMBOLS'] && !empty($this->language_data['SYMBOLS'])) {
1962
- $this->language_data['MULTIPLE_SYMBOL_GROUPS'] = count($this->language_data['STYLES']['SYMBOLS']) > 1;
1963
-
1964
- $this->language_data['SYMBOL_DATA'] = array();
1965
- $symbol_preg_multi = array(); // multi char symbols
1966
- $symbol_preg_single = array(); // single char symbols
1967
- foreach ($this->language_data['SYMBOLS'] as $key => $symbols) {
1968
- if (is_array($symbols)) {
1969
- foreach ($symbols as $sym) {
1970
- $sym = $this->hsc($sym);
1971
- if (!isset($this->language_data['SYMBOL_DATA'][$sym])) {
1972
- $this->language_data['SYMBOL_DATA'][$sym] = $key;
1973
- if (isset($sym[1])) { // multiple chars
1974
- $symbol_preg_multi[] = preg_quote($sym, '/');
1975
- } else { // single char
1976
- if ($sym == '-') {
1977
- // don't trigger range out of order error
1978
- $symbol_preg_single[] = '\-';
1979
- } else {
1980
- $symbol_preg_single[] = preg_quote($sym, '/');
1981
- }
1982
- }
1983
- }
1984
- }
1985
- } else {
1986
- $symbols = $this->hsc($symbols);
1987
- if (!isset($this->language_data['SYMBOL_DATA'][$symbols])) {
1988
- $this->language_data['SYMBOL_DATA'][$symbols] = 0;
1989
- if (isset($symbols[1])) { // multiple chars
1990
- $symbol_preg_multi[] = preg_quote($symbols, '/');
1991
- } else if ($symbols == '-') {
1992
- // don't trigger range out of order error
1993
- $symbol_preg_single[] = '\-';
1994
- } else { // single char
1995
- $symbol_preg_single[] = preg_quote($symbols, '/');
1996
- }
1997
- }
1998
- }
1999
- }
2000
-
2001
- //Now we have an array with each possible symbol as the key and the style as the actual data.
2002
- //This way we can set the correct style just the moment we highlight ...
2003
- //
2004
- //Now we need to rewrite our array to get a search string that
2005
- $symbol_preg = array();
2006
- if (!empty($symbol_preg_multi)) {
2007
- rsort($symbol_preg_multi);
2008
- $symbol_preg[] = implode('|', $symbol_preg_multi);
2009
- }
2010
- if (!empty($symbol_preg_single)) {
2011
- rsort($symbol_preg_single);
2012
- $symbol_preg[] = '[' . implode('', $symbol_preg_single) . ']';
2013
- }
2014
- $this->language_data['SYMBOL_SEARCH'] = implode("|", $symbol_preg);
2015
- }
2016
-
2017
- // cache optimized regexp for keyword matching
2018
- // remove old cache
2019
- $this->language_data['CACHED_KEYWORD_LISTS'] = array();
2020
- foreach (array_keys($this->language_data['KEYWORDS']) as $key) {
2021
- if (!isset($this->lexic_permissions['KEYWORDS'][$key]) ||
2022
- $this->lexic_permissions['KEYWORDS'][$key]) {
2023
- $this->optimize_keyword_group($key);
2024
- }
2025
- }
2026
-
2027
- // brackets
2028
- if ($this->lexic_permissions['BRACKETS']) {
2029
- $this->language_data['CACHE_BRACKET_MATCH'] = array('[', ']', '(', ')', '{', '}');
2030
- if (!$this->use_classes && isset($this->language_data['STYLES']['BRACKETS'][0])) {
2031
- $this->language_data['CACHE_BRACKET_REPLACE'] = array(
2032
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#91;|>',
2033
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#93;|>',
2034
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#40;|>',
2035
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#41;|>',
2036
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#123;|>',
2037
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#125;|>',
2038
- );
2039
- }
2040
- else {
2041
- $this->language_data['CACHE_BRACKET_REPLACE'] = array(
2042
- '<| class="br0">&#91;|>',
2043
- '<| class="br0">&#93;|>',
2044
- '<| class="br0">&#40;|>',
2045
- '<| class="br0">&#41;|>',
2046
- '<| class="br0">&#123;|>',
2047
- '<| class="br0">&#125;|>',
2048
- );
2049
- }
2050
- }
2051
-
2052
- //Build the parse cache needed to highlight numbers appropriate
2053
- if($this->lexic_permissions['NUMBERS']) {
2054
- //Check if the style rearrangements have been processed ...
2055
- //This also does some preprocessing to check which style groups are useable ...
2056
- if(!isset($this->language_data['NUMBERS_CACHE'])) {
2057
- $this->build_style_cache();
2058
- }
2059
-
2060
- //Number format specification
2061
- //All this formats are matched case-insensitively!
2062
- static $numbers_format = array(
2063
- GESHI_NUMBER_INT_BASIC =>
2064
- '(?:(?<![0-9a-z_\.%$@])|(?<=\.\.))(?<![\d\.]e[+\-])([1-9]\d*?|0)(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2065
- GESHI_NUMBER_INT_CSTYLE =>
2066
- '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])([1-9]\d*?|0)l(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2067
- GESHI_NUMBER_BIN_SUFFIX =>
2068
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])[01]+?[bB](?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2069
- GESHI_NUMBER_BIN_PREFIX_PERCENT =>
2070
- '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])%[01]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2071
- GESHI_NUMBER_BIN_PREFIX_0B =>
2072
- '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])0b[01]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2073
- GESHI_NUMBER_OCT_PREFIX =>
2074
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])0[0-7]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2075
- GESHI_NUMBER_OCT_PREFIX_0O =>
2076
- '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])0o[0-7]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2077
- GESHI_NUMBER_OCT_PREFIX_AT =>
2078
- '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])\@[0-7]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2079
- GESHI_NUMBER_OCT_SUFFIX =>
2080
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])[0-7]+?o(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2081
- GESHI_NUMBER_HEX_PREFIX =>
2082
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])0x[0-9a-fA-F]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2083
- GESHI_NUMBER_HEX_PREFIX_DOLLAR =>
2084
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])\$[0-9a-fA-F]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2085
- GESHI_NUMBER_HEX_SUFFIX =>
2086
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])\d[0-9a-fA-F]*?[hH](?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2087
- GESHI_NUMBER_FLT_NONSCI =>
2088
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])\d+?\.\d+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2089
- GESHI_NUMBER_FLT_NONSCI_F =>
2090
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])(?:\d+?(?:\.\d*?)?|\.\d+?)f(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2091
- GESHI_NUMBER_FLT_SCI_SHORT =>
2092
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])\.\d+?(?:e[+\-]?\d+?)?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
2093
- GESHI_NUMBER_FLT_SCI_ZERO =>
2094
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])(?:\d+?(?:\.\d*?)?|\.\d+?)(?:e[+\-]?\d+?)?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)'
2095
- );
2096
-
2097
- //At this step we have an associative array with flag groups for a
2098
- //specific style or an string denoting a regexp given its index.
2099
- $this->language_data['NUMBERS_RXCACHE'] = array();
2100
- foreach($this->language_data['NUMBERS_CACHE'] as $key => $rxdata) {
2101
- if(is_string($rxdata)) {
2102
- $regexp = $rxdata;
2103
- } else {
2104
- //This is a bitfield of number flags to highlight:
2105
- //Build an array, implode them together and make this the actual RX
2106
- $rxuse = array();
2107
- for($i = 1; $i <= $rxdata; $i<<=1) {
2108
- if($rxdata & $i) {
2109
- $rxuse[] = $numbers_format[$i];
2110
- }
2111
- }
2112
- $regexp = implode("|", $rxuse);
2113
- }
2114
-
2115
- $this->language_data['NUMBERS_RXCACHE'][$key] =
2116
- "/(?<!<\|\/)(?<!<\|!REG3XP)(?<!<\|\/NUM!)(?<!\d\/>)($regexp)(?!(?:<DOT>|(?>[^\<]))+>)(?![^<]*>)(?!\|>)(?!\/>)/i"; //
2117
- }
2118
-
2119
- if(!isset($this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'])) {
2120
- $this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'] = '#\d#';
2121
- }
2122
- }
2123
-
2124
- $this->parse_cache_built = true;
2125
- }
2126
-
2127
- /**
2128
- * Returns the code in $this->source, highlighted and surrounded by the
2129
- * nessecary HTML.
2130
- *
2131
- * This should only be called ONCE, cos it's SLOW! If you want to highlight
2132
- * the same source multiple times, you're better off doing a whole lot of
2133
- * str_replaces to replace the &lt;span&gt;s
2134
- *
2135
- * @since 1.0.0
2136
- */
2137
- function parse_code () {
2138
- // Start the timer
2139
- $start_time = microtime();
2140
-
2141
- // Replace all newlines to a common form.
2142
- $code = str_replace("\r\n", "\n", $this->source);
2143
- $code = str_replace("\r", "\n", $code);
2144
-
2145
- // Firstly, if there is an error, we won't highlight
2146
- if ($this->error) {
2147
- //Escape the source for output
2148
- $result = $this->hsc($this->source);
2149
-
2150
- //This fix is related to SF#1923020, but has to be applied regardless of
2151
- //actually highlighting symbols.
2152
- $result = str_replace(array('<SEMI>', '<PIPE>'), array(';', '|'), $result);
2153
-
2154
- // Timing is irrelevant
2155
- $this->set_time($start_time, $start_time);
2156
- $this->finalise($result);
2157
- return $result;
2158
- }
2159
-
2160
- // make sure the parse cache is up2date
2161
- if (!$this->parse_cache_built) {
2162
- $this->build_parse_cache();
2163
- }
2164
-
2165
- // Initialise various stuff
2166
- $length = strlen($code);
2167
- $COMMENT_MATCHED = false;
2168
- $stuff_to_parse = '';
2169
- $endresult = '';
2170
-
2171
- // "Important" selections are handled like multiline comments
2172
- // @todo GET RID OF THIS SHIZ
2173
- if ($this->enable_important_blocks) {
2174
- $this->language_data['COMMENT_MULTI'][GESHI_START_IMPORTANT] = GESHI_END_IMPORTANT;
2175
- }
2176
-
2177
- if ($this->strict_mode) {
2178
- // Break the source into bits. Each bit will be a portion of the code
2179
- // within script delimiters - for example, HTML between < and >
2180
- $k = 0;
2181
- $parts = array();
2182
- $matches = array();
2183
- $next_match_pointer = null;
2184
- // we use a copy to unset delimiters on demand (when they are not found)
2185
- $delim_copy = $this->language_data['SCRIPT_DELIMITERS'];
2186
- $i = 0;
2187
- while ($i < $length) {
2188
- $next_match_pos = $length + 1; // never true
2189
- foreach ($delim_copy as $dk => $delimiters) {
2190
- if(is_array($delimiters)) {
2191
- foreach ($delimiters as $open => $close) {
2192
- // make sure the cache is setup properly
2193
- if (!isset($matches[$dk][$open])) {
2194
- $matches[$dk][$open] = array(
2195
- 'next_match' => -1,
2196
- 'dk' => $dk,
2197
-
2198
- 'open' => $open, // needed for grouping of adjacent code blocks (see below)
2199
- 'open_strlen' => strlen($open),
2200
-
2201
- 'close' => $close,
2202
- 'close_strlen' => strlen($close),
2203
- );
2204
- }
2205
- // Get the next little bit for this opening string
2206
- if ($matches[$dk][$open]['next_match'] < $i) {
2207
- // only find the next pos if it was not already cached
2208
- $open_pos = strpos($code, $open, $i);
2209
- if ($open_pos === false) {
2210
- // no match for this delimiter ever
2211
- unset($delim_copy[$dk][$open]);
2212
- continue;
2213
- }
2214
- $matches[$dk][$open]['next_match'] = $open_pos;
2215
- }
2216
- if ($matches[$dk][$open]['next_match'] < $next_match_pos) {
2217
- //So we got a new match, update the close_pos
2218
- $matches[$dk][$open]['close_pos'] =
2219
- strpos($code, $close, $matches[$dk][$open]['next_match']+1);
2220
-
2221
- $next_match_pointer =& $matches[$dk][$open];
2222
- $next_match_pos = $matches[$dk][$open]['next_match'];
2223
- }
2224
- }
2225
- } else {
2226
- //So we should match an RegExp as Strict Block ...
2227
- /**
2228
- * The value in $delimiters is expected to be an RegExp
2229
- * containing exactly 2 matching groups:
2230
- * - Group 1 is the opener
2231
- * - Group 2 is the closer
2232
- */
2233
- if(!GESHI_PHP_PRE_433 && //Needs proper rewrite to work with PHP >=4.3.0; 4.3.3 is guaranteed to work.
2234
- preg_match($delimiters, $code, $matches_rx, PREG_OFFSET_CAPTURE, $i)) {
2235
- //We got a match ...
2236
- if(isset($matches_rx['start']) && isset($matches_rx['end']))
2237
- {
2238
- $matches[$dk] = array(
2239
- 'next_match' => $matches_rx['start'][1],
2240
- 'dk' => $dk,
2241
-
2242
- 'close_strlen' => strlen($matches_rx['end'][0]),
2243
- 'close_pos' => $matches_rx['end'][1],
2244
- );
2245
- } else {
2246
- $matches[$dk] = array(
2247
- 'next_match' => $matches_rx[1][1],
2248
- 'dk' => $dk,
2249
-
2250
- 'close_strlen' => strlen($matches_rx[2][0]),
2251
- 'close_pos' => $matches_rx[2][1],
2252
- );
2253
- }
2254
- } else {
2255
- // no match for this delimiter ever
2256
- unset($delim_copy[$dk]);
2257
- continue;
2258
- }
2259
-
2260
- if ($matches[$dk]['next_match'] <= $next_match_pos) {
2261
- $next_match_pointer =& $matches[$dk];
2262
- $next_match_pos = $matches[$dk]['next_match'];
2263
- }
2264
- }
2265
- }
2266
-
2267
- // non-highlightable text
2268
- $parts[$k] = array(
2269
- 1 => substr($code, $i, $next_match_pos - $i)
2270
- );
2271
- ++$k;
2272
-
2273
- if ($next_match_pos > $length) {
2274
- // out of bounds means no next match was found
2275
- break;
2276
- }
2277
-
2278
- // highlightable code
2279
- $parts[$k][0] = $next_match_pointer['dk'];
2280
-
2281
- //Only combine for non-rx script blocks
2282
- if(is_array($delim_copy[$next_match_pointer['dk']])) {
2283
- // group adjacent script blocks, e.g. <foobar><asdf> should be one block, not three!
2284
- $i = $next_match_pos + $next_match_pointer['open_strlen'];
2285
- while (true) {
2286
- $close_pos = strpos($code, $next_match_pointer['close'], $i);
2287
- if ($close_pos == false) {
2288
- break;
2289
- }
2290
- $i = $close_pos + $next_match_pointer['close_strlen'];
2291
- if ($i == $length) {
2292
- break;
2293
- }
2294
- if ($code[$i] == $next_match_pointer['open'][0] && ($next_match_pointer['open_strlen'] == 1 ||
2295
- substr($code, $i, $next_match_pointer['open_strlen']) == $next_match_pointer['open'])) {
2296
- // merge adjacent but make sure we don't merge things like <tag><!-- comment -->
2297
- foreach ($matches as $submatches) {
2298
- foreach ($submatches as $match) {
2299
- if ($match['next_match'] == $i) {
2300
- // a different block already matches here!
2301
- break 3;
2302
- }
2303
- }
2304
- }
2305
- } else {
2306
- break;
2307
- }
2308
- }
2309
- } else {
2310
- $close_pos = $next_match_pointer['close_pos'] + $next_match_pointer['close_strlen'];
2311
- $i = $close_pos;
2312
- }
2313
-
2314
- if ($close_pos === false) {
2315
- // no closing delimiter found!
2316
- $parts[$k][1] = substr($code, $next_match_pos);
2317
- ++$k;
2318
- break;
2319
- } else {
2320
- $parts[$k][1] = substr($code, $next_match_pos, $i - $next_match_pos);
2321
- ++$k;
2322
- }
2323
- }
2324
- unset($delim_copy, $next_match_pointer, $next_match_pos, $matches);
2325
- $num_parts = $k;
2326
-
2327
- if ($num_parts == 1 && $this->strict_mode == GESHI_MAYBE) {
2328
- // when we have only one part, we don't have anything to highlight at all.
2329
- // if we have a "maybe" strict language, this should be handled as highlightable code
2330
- $parts = array(
2331
- 0 => array(
2332
- 0 => '',
2333
- 1 => ''
2334
- ),
2335
- 1 => array(
2336
- 0 => null,
2337
- 1 => $parts[0][1]
2338
- )
2339
- );
2340
- $num_parts = 2;
2341
- }
2342
-
2343
- } else {
2344
- // Not strict mode - simply dump the source into
2345
- // the array at index 1 (the first highlightable block)
2346
- $parts = array(
2347
- 0 => array(
2348
- 0 => '',
2349
- 1 => ''
2350
- ),
2351
- 1 => array(
2352
- 0 => null,
2353
- 1 => $code
2354
- )
2355
- );
2356
- $num_parts = 2;
2357
- }
2358
-
2359
- //Unset variables we won't need any longer
2360
- unset($code);
2361
-
2362
- //Preload some repeatedly used values regarding hardquotes ...
2363
- $hq = isset($this->language_data['HARDQUOTE']) ? $this->language_data['HARDQUOTE'][0] : false;
2364
- $hq_strlen = strlen($hq);
2365
-
2366
- //Preload if line numbers are to be generated afterwards
2367
- //Added a check if line breaks should be forced even without line numbers, fixes SF#1727398
2368
- $check_linenumbers = $this->line_numbers != GESHI_NO_LINE_NUMBERS ||
2369
- !empty($this->highlight_extra_lines) || !$this->allow_multiline_span;
2370
-
2371
- //preload the escape char for faster checking ...
2372
- $escaped_escape_char = $this->hsc($this->language_data['ESCAPE_CHAR']);
2373
-
2374
- // this is used for single-line comments
2375
- $sc_disallowed_before = "";
2376
- $sc_disallowed_after = "";
2377
-
2378
- if (isset($this->language_data['PARSER_CONTROL'])) {
2379
- if (isset($this->language_data['PARSER_CONTROL']['COMMENTS'])) {
2380
- if (isset($this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_BEFORE'])) {
2381
- $sc_disallowed_before = $this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_BEFORE'];
2382
- }
2383
- if (isset($this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_AFTER'])) {
2384
- $sc_disallowed_after = $this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_AFTER'];
2385
- }
2386
- }
2387
- }
2388
-
2389
- //Fix for SF#1932083: Multichar Quotemarks unsupported
2390
- $is_string_starter = array();
2391
- if ($this->lexic_permissions['STRINGS']) {
2392
- foreach ($this->language_data['QUOTEMARKS'] as $quotemark) {
2393
- if (!isset($is_string_starter[$quotemark[0]])) {
2394
- $is_string_starter[$quotemark[0]] = (string)$quotemark;
2395
- } else if (is_string($is_string_starter[$quotemark[0]])) {
2396
- $is_string_starter[$quotemark[0]] = array(
2397
- $is_string_starter[$quotemark[0]],
2398
- $quotemark);
2399
- } else {
2400
- $is_string_starter[$quotemark[0]][] = $quotemark;
2401
- }
2402
- }
2403
- }
2404
-
2405
- // Now we go through each part. We know that even-indexed parts are
2406
- // code that shouldn't be highlighted, and odd-indexed parts should
2407
- // be highlighted
2408
- for ($key = 0; $key < $num_parts; ++$key) {
2409
- $STRICTATTRS = '';
2410
-
2411
- // If this block should be highlighted...
2412
- if (!($key & 1)) {
2413
- // Else not a block to highlight
2414
- $endresult .= $this->hsc($parts[$key][1]);
2415
- unset($parts[$key]);
2416
- continue;
2417
- }
2418
-
2419
- $result = '';
2420
- $part = $parts[$key][1];
2421
-
2422
- $highlight_part = true;
2423
- if ($this->strict_mode && !is_null($parts[$key][0])) {
2424
- // get the class key for this block of code
2425
- $script_key = $parts[$key][0];
2426
- $highlight_part = $this->language_data['HIGHLIGHT_STRICT_BLOCK'][$script_key];
2427
- if ($this->language_data['STYLES']['SCRIPT'][$script_key] != '' &&
2428
- $this->lexic_permissions['SCRIPT']) {
2429
- // Add a span element around the source to
2430
- // highlight the overall source block
2431
- if (!$this->use_classes &&
2432
- $this->language_data['STYLES']['SCRIPT'][$script_key] != '') {
2433
- $attributes = ' style="' . $this->language_data['STYLES']['SCRIPT'][$script_key] . '"';
2434
- } else {
2435
- $attributes = ' class="sc' . $script_key . '"';
2436
- }
2437
- $result .= "<span$attributes>";
2438
- $STRICTATTRS = $attributes;
2439
- }
2440
- }
2441
-
2442
- if ($highlight_part) {
2443
- // Now, highlight the code in this block. This code
2444
- // is really the engine of GeSHi (along with the method
2445
- // parse_non_string_part).
2446
-
2447
- // cache comment regexps incrementally
2448
- $next_comment_regexp_key = '';
2449
- $next_comment_regexp_pos = -1;
2450
- $next_comment_multi_pos = -1;
2451
- $next_comment_single_pos = -1;
2452
- $comment_regexp_cache_per_key = array();
2453
- $comment_multi_cache_per_key = array();
2454
- $comment_single_cache_per_key = array();
2455
- $next_open_comment_multi = '';
2456
- $next_comment_single_key = '';
2457
- $escape_regexp_cache_per_key = array();
2458
- $next_escape_regexp_key = '';
2459
- $next_escape_regexp_pos = -1;
2460
-
2461
- $length = strlen($part);
2462
- for ($i = 0; $i < $length; ++$i) {
2463
- // Get the next char
2464
- $char = $part[$i];
2465
- $char_len = 1;
2466
-
2467
- // update regexp comment cache if needed
2468
- if (isset($this->language_data['COMMENT_REGEXP']) && $next_comment_regexp_pos < $i) {
2469
- $next_comment_regexp_pos = $length;
2470
- foreach ($this->language_data['COMMENT_REGEXP'] as $comment_key => $regexp) {
2471
- $match_i = false;
2472
- if (isset($comment_regexp_cache_per_key[$comment_key]) &&
2473
- ($comment_regexp_cache_per_key[$comment_key]['pos'] >= $i ||
2474
- $comment_regexp_cache_per_key[$comment_key]['pos'] === false)) {
2475
- // we have already matched something
2476
- if ($comment_regexp_cache_per_key[$comment_key]['pos'] === false) {
2477
- // this comment is never matched
2478
- continue;
2479
- }
2480
- $match_i = $comment_regexp_cache_per_key[$comment_key]['pos'];
2481
- } else if (
2482
- //This is to allow use of the offset parameter in preg_match and stay as compatible with older PHP versions as possible
2483
- (GESHI_PHP_PRE_433 && preg_match($regexp, substr($part, $i), $match, PREG_OFFSET_CAPTURE)) ||
2484
- (!GESHI_PHP_PRE_433 && preg_match($regexp, $part, $match, PREG_OFFSET_CAPTURE, $i))
2485
- ) {
2486
- $match_i = $match[0][1];
2487
- if (GESHI_PHP_PRE_433) {
2488
- $match_i += $i;
2489
- }
2490
-
2491
- $comment_regexp_cache_per_key[$comment_key] = array(
2492
- 'key' => $comment_key,
2493
- 'length' => strlen($match[0][0]),
2494
- 'pos' => $match_i
2495
- );
2496
- } else {
2497
- $comment_regexp_cache_per_key[$comment_key]['pos'] = false;
2498
- continue;
2499
- }
2500
-
2501
- if ($match_i !== false && $match_i < $next_comment_regexp_pos) {
2502
- $next_comment_regexp_pos = $match_i;
2503
- $next_comment_regexp_key = $comment_key;
2504
- if ($match_i === $i) {
2505
- break;
2506
- }
2507
- }
2508
- }
2509
- }
2510
-
2511
- $string_started = false;
2512
-
2513
- if (isset($is_string_starter[$char])) {
2514
- // Possibly the start of a new string ...
2515
-
2516
- //Check which starter it was ...
2517
- //Fix for SF#1932083: Multichar Quotemarks unsupported
2518
- if (is_array($is_string_starter[$char])) {
2519
- $char_new = '';
2520
- foreach ($is_string_starter[$char] as $testchar) {
2521
- if ($testchar === substr($part, $i, strlen($testchar)) &&
2522
- strlen($testchar) > strlen($char_new)) {
2523
- $char_new = $testchar;
2524
- $string_started = true;
2525
- }
2526
- }
2527
- if ($string_started) {
2528
- $char = $char_new;
2529
- }
2530
- } else {
2531
- $testchar = $is_string_starter[$char];
2532
- if ($testchar === substr($part, $i, strlen($testchar))) {
2533
- $char = $testchar;
2534
- $string_started = true;
2535
- }
2536
- }
2537
- $char_len = strlen($char);
2538
- }
2539
-
2540
- if ($string_started && ($i != $next_comment_regexp_pos)) {
2541
- // Hand out the correct style information for this string
2542
- $string_key = array_search($char, $this->language_data['QUOTEMARKS']);
2543
- if (!isset($this->language_data['STYLES']['STRINGS'][$string_key]) ||
2544
- !isset($this->language_data['STYLES']['ESCAPE_CHAR'][$string_key])) {
2545
- $string_key = 0;
2546
- }
2547
-
2548
- // parse the stuff before this
2549
- $result .= $this->parse_non_string_part($stuff_to_parse);
2550
- $stuff_to_parse = '';
2551
-
2552
- if (!$this->use_classes) {
2553
- $string_attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][$string_key] . '"';
2554
- } else {
2555
- $string_attributes = ' class="st'.$string_key.'"';
2556
- }
2557
-
2558
- // now handle the string
2559
- $string = "<span$string_attributes>" . GeSHi::hsc($char);
2560
- $start = $i + $char_len;
2561
- $string_open = true;
2562
-
2563
- if(empty($this->language_data['ESCAPE_REGEXP'])) {
2564
- $next_escape_regexp_pos = $length;
2565
- }
2566
-
2567
- do {
2568
- //Get the regular ending pos ...
2569
- $close_pos = strpos($part, $char, $start);
2570
- if(false === $close_pos) {
2571
- $close_pos = $length;
2572
- }
2573
-
2574
- if($this->lexic_permissions['ESCAPE_CHAR']) {
2575
- // update escape regexp cache if needed
2576
- if (isset($this->language_data['ESCAPE_REGEXP']) && $next_escape_regexp_pos < $start) {
2577
- $next_escape_regexp_pos = $length;
2578
- foreach ($this->language_data['ESCAPE_REGEXP'] as $escape_key => $regexp) {
2579
- $match_i = false;
2580
- if (isset($escape_regexp_cache_per_key[$escape_key]) &&
2581
- ($escape_regexp_cache_per_key[$escape_key]['pos'] >= $start ||
2582
- $escape_regexp_cache_per_key[$escape_key]['pos'] === false)) {
2583
- // we have already matched something
2584
- if ($escape_regexp_cache_per_key[$escape_key]['pos'] === false) {
2585
- // this comment is never matched
2586
- continue;
2587
- }
2588
- $match_i = $escape_regexp_cache_per_key[$escape_key]['pos'];
2589
- } else if (
2590
- //This is to allow use of the offset parameter in preg_match and stay as compatible with older PHP versions as possible
2591
- (GESHI_PHP_PRE_433 && preg_match($regexp, substr($part, $start), $match, PREG_OFFSET_CAPTURE)) ||
2592
- (!GESHI_PHP_PRE_433 && preg_match($regexp, $part, $match, PREG_OFFSET_CAPTURE, $start))
2593
- ) {
2594
- $match_i = $match[0][1];
2595
- if (GESHI_PHP_PRE_433) {
2596
- $match_i += $start;
2597
- }
2598
-
2599
- $escape_regexp_cache_per_key[$escape_key] = array(
2600
- 'key' => $escape_key,
2601
- 'length' => strlen($match[0][0]),
2602
- 'pos' => $match_i
2603
- );
2604
- } else {
2605
- $escape_regexp_cache_per_key[$escape_key]['pos'] = false;
2606
- continue;
2607
- }
2608
-
2609
- if ($match_i !== false && $match_i < $next_escape_regexp_pos) {
2610
- $next_escape_regexp_pos = $match_i;
2611
- $next_escape_regexp_key = $escape_key;
2612
- if ($match_i === $start) {
2613
- break;
2614
- }
2615
- }
2616
- }
2617
- }
2618
-
2619
- //Find the next simple escape position
2620
- if('' != $this->language_data['ESCAPE_CHAR']) {
2621
- $simple_escape = strpos($part, $this->language_data['ESCAPE_CHAR'], $start);
2622
- if(false === $simple_escape) {
2623
- $simple_escape = $length;
2624
- }
2625
- } else {
2626
- $simple_escape = $length;
2627
- }
2628
- } else {
2629
- $next_escape_regexp_pos = $length;
2630
- $simple_escape = $length;
2631
- }
2632
-
2633
- if($simple_escape < $next_escape_regexp_pos &&
2634
- $simple_escape < $length &&
2635
- $simple_escape < $close_pos) {
2636
- //The nexxt escape sequence is a simple one ...
2637
- $es_pos = $simple_escape;
2638
-
2639
- //Add the stuff not in the string yet ...
2640
- $string .= $this->hsc(substr($part, $start, $es_pos - $start));
2641
-
2642
- //Get the style for this escaped char ...
2643
- if (!$this->use_classes) {
2644
- $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][0] . '"';
2645
- } else {
2646
- $escape_char_attributes = ' class="es0"';
2647
- }
2648
-
2649
- //Add the style for the escape char ...
2650
- $string .= "<span$escape_char_attributes>" .
2651
- GeSHi::hsc($this->language_data['ESCAPE_CHAR']);
2652
-
2653
- //Get the byte AFTER the ESCAPE_CHAR we just found
2654
- $es_char = $part[$es_pos + 1];
2655
- if ($es_char == "\n") {
2656
- // don't put a newline around newlines
2657
- $string .= "</span>\n";
2658
- $start = $es_pos + 2;
2659
- } else if (ord($es_char) >= 128) {
2660
- //This is an non-ASCII char (UTF8 or single byte)
2661
- //This code tries to work around SF#2037598 ...
2662
- if(function_exists('mb_substr')) {
2663
- $es_char_m = mb_substr(substr($part, $es_pos+1, 16), 0, 1, $this->encoding);
2664
- $string .= $es_char_m . '</span>';
2665
- } else if (!GESHI_PHP_PRE_433 && 'utf-8' == $this->encoding) {
2666
- if(preg_match("/[\xC2-\xDF][\x80-\xBF]".
2667
- "|\xE0[\xA0-\xBF][\x80-\xBF]".
2668
- "|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}".
2669
- "|\xED[\x80-\x9F][\x80-\xBF]".
2670
- "|\xF0[\x90-\xBF][\x80-\xBF]{2}".
2671
- "|[\xF1-\xF3][\x80-\xBF]{3}".
2672
- "|\xF4[\x80-\x8F][\x80-\xBF]{2}/s",
2673
- $part, $es_char_m, null, $es_pos + 1)) {
2674
- $es_char_m = $es_char_m[0];
2675
- } else {
2676
- $es_char_m = $es_char;
2677
- }
2678
- $string .= $this->hsc($es_char_m) . '</span>';
2679
- } else {
2680
- $es_char_m = $this->hsc($es_char);
2681
- }
2682
- $start = $es_pos + strlen($es_char_m) + 1;
2683
- } else {
2684
- $string .= $this->hsc($es_char) . '</span>';
2685
- $start = $es_pos + 2;
2686
- }
2687
- } else if ($next_escape_regexp_pos < $length &&
2688
- $next_escape_regexp_pos < $close_pos) {
2689
- $es_pos = $next_escape_regexp_pos;
2690
- //Add the stuff not in the string yet ...
2691
- $string .= $this->hsc(substr($part, $start, $es_pos - $start));
2692
-
2693
- //Get the key and length of this match ...
2694
- $escape = $escape_regexp_cache_per_key[$next_escape_regexp_key];
2695
- $escape_str = substr($part, $es_pos, $escape['length']);
2696
- $escape_key = $escape['key'];
2697
-
2698
- //Get the style for this escaped char ...
2699
- if (!$this->use_classes) {
2700
- $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][$escape_key] . '"';
2701
- } else {
2702
- $escape_char_attributes = ' class="es' . $escape_key . '"';
2703
- }
2704
-
2705
- //Add the style for the escape char ...
2706
- $string .= "<span$escape_char_attributes>" .
2707
- $this->hsc($escape_str) . '</span>';
2708
-
2709
- $start = $es_pos + $escape['length'];
2710
- } else {
2711
- //Copy the remainder of the string ...
2712
- $string .= $this->hsc(substr($part, $start, $close_pos - $start + $char_len)) . '</span>';
2713
- $start = $close_pos + $char_len;
2714
- $string_open = false;
2715
- }
2716
- } while($string_open);
2717
-
2718
- if ($check_linenumbers) {
2719
- // Are line numbers used? If, we should end the string before
2720
- // the newline and begin it again (so when <li>s are put in the source
2721
- // remains XHTML compliant)
2722
- // note to self: This opens up possibility of config files specifying
2723
- // that languages can/cannot have multiline strings???
2724
- $string = str_replace("\n", "</span>\n<span$string_attributes>", $string);
2725
- }
2726
-
2727
- $result .= $string;
2728
- $string = '';
2729
- $i = $start - 1;
2730
- continue;
2731
- } else if ($this->lexic_permissions['STRINGS'] && $hq && $hq[0] == $char &&
2732
- substr($part, $i, $hq_strlen) == $hq && ($i != $next_comment_regexp_pos)) {
2733
- // The start of a hard quoted string
2734
- if (!$this->use_classes) {
2735
- $string_attributes = ' style="' . $this->language_data['STYLES']['STRINGS']['HARD'] . '"';
2736
- $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR']['HARD'] . '"';
2737
- } else {
2738
- $string_attributes = ' class="st_h"';
2739
- $escape_char_attributes = ' class="es_h"';
2740
- }
2741
- // parse the stuff before this
2742
- $result .= $this->parse_non_string_part($stuff_to_parse);
2743
- $stuff_to_parse = '';
2744
-
2745
- // now handle the string
2746
- $string = '';
2747
-
2748
- // look for closing quote
2749
- $start = $i + $hq_strlen;
2750
- while ($close_pos = strpos($part, $this->language_data['HARDQUOTE'][1], $start)) {
2751
- $start = $close_pos + 1;
2752
- if ($this->lexic_permissions['ESCAPE_CHAR'] && $part[$close_pos - 1] == $this->language_data['HARDCHAR'] &&
2753
- (($i + $hq_strlen) != ($close_pos))) { //Support empty string for HQ escapes if Starter = Escape
2754
- // make sure this quote is not escaped
2755
- foreach ($this->language_data['HARDESCAPE'] as $hardescape) {
2756
- if (substr($part, $close_pos - 1, strlen($hardescape)) == $hardescape) {
2757
- // check wether this quote is escaped or if it is something like '\\'
2758
- $escape_char_pos = $close_pos - 1;
2759
- while ($escape_char_pos > 0
2760
- && $part[$escape_char_pos - 1] == $this->language_data['HARDCHAR']) {
2761
- --$escape_char_pos;
2762
- }
2763
- if (($close_pos - $escape_char_pos) & 1) {
2764
- // uneven number of escape chars => this quote is escaped
2765
- continue 2;
2766
- }
2767
- }
2768
- }
2769
- }
2770
-
2771
- // found closing quote
2772
- break;
2773
- }
2774
-
2775
- //Found the closing delimiter?
2776
- if (!$close_pos) {
2777
- // span till the end of this $part when no closing delimiter is found
2778
- $close_pos = $length;
2779
- }
2780
-
2781
- //Get the actual string
2782
- $string = substr($part, $i, $close_pos - $i + 1);
2783
- $i = $close_pos;
2784
-
2785
- // handle escape chars and encode html chars
2786
- // (special because when we have escape chars within our string they may not be escaped)
2787
- if ($this->lexic_permissions['ESCAPE_CHAR'] && $this->language_data['ESCAPE_CHAR']) {
2788
- $start = 0;
2789
- $new_string = '';
2790
- while ($es_pos = strpos($string, $this->language_data['ESCAPE_CHAR'], $start)) {
2791
- // hmtl escape stuff before
2792
- $new_string .= $this->hsc(substr($string, $start, $es_pos - $start));
2793
- // check if this is a hard escape
2794
- foreach ($this->language_data['HARDESCAPE'] as $hardescape) {
2795
- if (substr($string, $es_pos, strlen($hardescape)) == $hardescape) {
2796
- // indeed, this is a hardescape
2797
- $new_string .= "<span$escape_char_attributes>" .
2798
- $this->hsc($hardescape) . '</span>';
2799
- $start = $es_pos + strlen($hardescape);
2800
- continue 2;
2801
- }
2802
- }
2803
- // not a hard escape, but a normal escape
2804
- // they come in pairs of two
2805
- $c = 0;
2806
- while (isset($string[$es_pos + $c]) && isset($string[$es_pos + $c + 1])
2807
- && $string[$es_pos + $c] == $this->language_data['ESCAPE_CHAR']
2808
- && $string[$es_pos + $c + 1] == $this->language_data['ESCAPE_CHAR']) {
2809
- $c += 2;
2810
- }
2811
- if ($c) {
2812
- $new_string .= "<span$escape_char_attributes>" .
2813
- str_repeat($escaped_escape_char, $c) .
2814
- '</span>';
2815
- $start = $es_pos + $c;
2816
- } else {
2817
- // this is just a single lonely escape char...
2818
- $new_string .= $escaped_escape_char;
2819
- $start = $es_pos + 1;
2820
- }
2821
- }
2822
- $string = $new_string . $this->hsc(substr($string, $start));
2823
- } else {
2824
- $string = $this->hsc($string);
2825
- }
2826
-
2827
- if ($check_linenumbers) {
2828
- // Are line numbers used? If, we should end the string before
2829
- // the newline and begin it again (so when <li>s are put in the source
2830
- // remains XHTML compliant)
2831
- // note to self: This opens up possibility of config files specifying
2832
- // that languages can/cannot have multiline strings???
2833
- $string = str_replace("\n", "</span>\n<span$string_attributes>", $string);
2834
- }
2835
-
2836
- $result .= "<span$string_attributes>" . $string . '</span>';
2837
- $string = '';
2838
- continue;
2839
- } else {
2840
- //Have a look for regexp comments
2841
- if ($i == $next_comment_regexp_pos) {
2842
- $COMMENT_MATCHED = true;
2843
- $comment = $comment_regexp_cache_per_key[$next_comment_regexp_key];
2844
- $test_str = $this->hsc(substr($part, $i, $comment['length']));
2845
-
2846
- //@todo If remove important do remove here
2847
- if ($this->lexic_permissions['COMMENTS']['MULTI']) {
2848
- if (!$this->use_classes) {
2849
- $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment['key']] . '"';
2850
- } else {
2851
- $attributes = ' class="co' . $comment['key'] . '"';
2852
- }
2853
-
2854
- $test_str = "<span$attributes>" . $test_str . "</span>";
2855
-
2856
- // Short-cut through all the multiline code
2857
- if ($check_linenumbers) {
2858
- // strreplace to put close span and open span around multiline newlines
2859
- $test_str = str_replace(
2860
- "\n", "</span>\n<span$attributes>",
2861
- str_replace("\n ", "\n&nbsp;", $test_str)
2862
- );
2863
- }
2864
- }
2865
-
2866
- $i += $comment['length'] - 1;
2867
-
2868
- // parse the rest
2869
- $result .= $this->parse_non_string_part($stuff_to_parse);
2870
- $stuff_to_parse = '';
2871
- }
2872
-
2873
- // If we haven't matched a regexp comment, try multi-line comments
2874
- if (!$COMMENT_MATCHED) {
2875
- // Is this a multiline comment?
2876
- if (!empty($this->language_data['COMMENT_MULTI']) && $next_comment_multi_pos < $i) {
2877
- $next_comment_multi_pos = $length;
2878
- foreach ($this->language_data['COMMENT_MULTI'] as $open => $close) {
2879
- $match_i = false;
2880
- if (isset($comment_multi_cache_per_key[$open]) &&
2881
- ($comment_multi_cache_per_key[$open] >= $i ||
2882
- $comment_multi_cache_per_key[$open] === false)) {
2883
- // we have already matched something
2884
- if ($comment_multi_cache_per_key[$open] === false) {
2885
- // this comment is never matched
2886
- continue;
2887
- }
2888
- $match_i = $comment_multi_cache_per_key[$open];
2889
- } else if (($match_i = stripos($part, $open, $i)) !== false) {
2890
- $comment_multi_cache_per_key[$open] = $match_i;
2891
- } else {
2892
- $comment_multi_cache_per_key[$open] = false;
2893
- continue;
2894
- }
2895
- if ($match_i !== false && $match_i < $next_comment_multi_pos) {
2896
- $next_comment_multi_pos = $match_i;
2897
- $next_open_comment_multi = $open;
2898
- if ($match_i === $i) {
2899
- break;
2900
- }
2901
- }
2902
- }
2903
- }
2904
- if ($i == $next_comment_multi_pos) {
2905
- $open = $next_open_comment_multi;
2906
- $close = $this->language_data['COMMENT_MULTI'][$open];
2907
- $open_strlen = strlen($open);
2908
- $close_strlen = strlen($close);
2909
- $COMMENT_MATCHED = true;
2910
- $test_str_match = $open;
2911
- //@todo If remove important do remove here
2912
- if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
2913
- $open == GESHI_START_IMPORTANT) {
2914
- if ($open != GESHI_START_IMPORTANT) {
2915
- if (!$this->use_classes) {
2916
- $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS']['MULTI'] . '"';
2917
- } else {
2918
- $attributes = ' class="coMULTI"';
2919
- }
2920
- $test_str = "<span$attributes>" . $this->hsc($open);
2921
- } else {
2922
- if (!$this->use_classes) {
2923
- $attributes = ' style="' . $this->important_styles . '"';
2924
- } else {
2925
- $attributes = ' class="imp"';
2926
- }
2927
-
2928
- // We don't include the start of the comment if it's an
2929
- // "important" part
2930
- $test_str = "<span$attributes>";
2931
- }
2932
- } else {
2933
- $test_str = $this->hsc($open);
2934
- }
2935
-
2936
- $close_pos = strpos( $part, $close, $i + $open_strlen );
2937
-
2938
- if ($close_pos === false) {
2939
- $close_pos = $length;
2940
- }
2941
-
2942
- // Short-cut through all the multiline code
2943
- $rest_of_comment = $this->hsc(substr($part, $i + $open_strlen, $close_pos - $i - $open_strlen + $close_strlen));
2944
- if (($this->lexic_permissions['COMMENTS']['MULTI'] ||
2945
- $test_str_match == GESHI_START_IMPORTANT) &&
2946
- $check_linenumbers) {
2947
-
2948
- // strreplace to put close span and open span around multiline newlines
2949
- $test_str .= str_replace(
2950
- "\n", "</span>\n<span$attributes>",
2951
- str_replace("\n ", "\n&nbsp;", $rest_of_comment)
2952
- );
2953
- } else {
2954
- $test_str .= $rest_of_comment;
2955
- }
2956
-
2957
- if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
2958
- $test_str_match == GESHI_START_IMPORTANT) {
2959
- $test_str .= '</span>';
2960
- }
2961
-
2962
- $i = $close_pos + $close_strlen - 1;
2963
-
2964
- // parse the rest
2965
- $result .= $this->parse_non_string_part($stuff_to_parse);
2966
- $stuff_to_parse = '';
2967
- }
2968
- }
2969
-
2970
- // If we haven't matched a multiline comment, try single-line comments
2971
- if (!$COMMENT_MATCHED) {
2972
- // cache potential single line comment occurances
2973
- if (!empty($this->language_data['COMMENT_SINGLE']) && $next_comment_single_pos < $i) {
2974
- $next_comment_single_pos = $length;
2975
- foreach ($this->language_data['COMMENT_SINGLE'] as $comment_key => $comment_mark) {
2976
- $match_i = false;
2977
- if (isset($comment_single_cache_per_key[$comment_key]) &&
2978
- ($comment_single_cache_per_key[$comment_key] >= $i ||
2979
- $comment_single_cache_per_key[$comment_key] === false)) {
2980
- // we have already matched something
2981
- if ($comment_single_cache_per_key[$comment_key] === false) {
2982
- // this comment is never matched
2983
- continue;
2984
- }
2985
- $match_i = $comment_single_cache_per_key[$comment_key];
2986
- } else if (
2987
- // case sensitive comments
2988
- ($this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS] &&
2989
- ($match_i = stripos($part, $comment_mark, $i)) !== false) ||
2990
- // non case sensitive
2991
- (!$this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS] &&
2992
- (($match_i = strpos($part, $comment_mark, $i)) !== false))) {
2993
- $comment_single_cache_per_key[$comment_key] = $match_i;
2994
- } else {
2995
- $comment_single_cache_per_key[$comment_key] = false;
2996
- continue;
2997
- }
2998
- if ($match_i !== false && $match_i < $next_comment_single_pos) {
2999
- $next_comment_single_pos = $match_i;
3000
- $next_comment_single_key = $comment_key;
3001
- if ($match_i === $i) {
3002
- break;
3003
- }
3004
- }
3005
- }
3006
- }
3007
- if ($next_comment_single_pos == $i) {
3008
- $comment_key = $next_comment_single_key;
3009
- $comment_mark = $this->language_data['COMMENT_SINGLE'][$comment_key];
3010
- $com_len = strlen($comment_mark);
3011
-
3012
- // This check will find special variables like $# in bash
3013
- // or compiler directives of Delphi beginning {$
3014
- if ((empty($sc_disallowed_before) || ($i == 0) ||
3015
- (false === strpos($sc_disallowed_before, $part[$i-1]))) &&
3016
- (empty($sc_disallowed_after) || ($length <= $i + $com_len) ||
3017
- (false === strpos($sc_disallowed_after, $part[$i + $com_len]))))
3018
- {
3019
- // this is a valid comment
3020
- $COMMENT_MATCHED = true;
3021
- if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
3022
- if (!$this->use_classes) {
3023
- $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment_key] . '"';
3024
- } else {
3025
- $attributes = ' class="co' . $comment_key . '"';
3026
- }
3027
- $test_str = "<span$attributes>" . $this->hsc($this->change_case($comment_mark));
3028
- } else {
3029
- $test_str = $this->hsc($comment_mark);
3030
- }
3031
-
3032
- //Check if this comment is the last in the source
3033
- $close_pos = strpos($part, "\n", $i);
3034
- $oops = false;
3035
- if ($close_pos === false) {
3036
- $close_pos = $length;
3037
- $oops = true;
3038
- }
3039
- $test_str .= $this->hsc(substr($part, $i + $com_len, $close_pos - $i - $com_len));
3040
- if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
3041
- $test_str .= "</span>";
3042
- }
3043
-
3044
- // Take into account that the comment might be the last in the source
3045
- if (!$oops) {
3046
- $test_str .= "\n";
3047
- }
3048
-
3049
- $i = $close_pos;
3050
-
3051
- // parse the rest
3052
- $result .= $this->parse_non_string_part($stuff_to_parse);
3053
- $stuff_to_parse = '';
3054
- }
3055
- }
3056
- }
3057
- }
3058
-
3059
- // Where are we adding this char?
3060
- if (!$COMMENT_MATCHED) {
3061
- $stuff_to_parse .= $char;
3062
- } else {
3063
- $result .= $test_str;
3064
- unset($test_str);
3065
- $COMMENT_MATCHED = false;
3066
- }
3067
- }
3068
- // Parse the last bit
3069
- $result .= $this->parse_non_string_part($stuff_to_parse);
3070
- $stuff_to_parse = '';
3071
- } else {
3072
- $result .= $this->hsc($part);
3073
- }
3074
- // Close the <span> that surrounds the block
3075
- if ($STRICTATTRS != '') {
3076
- $result = str_replace("\n", "</span>\n<span$STRICTATTRS>", $result);
3077
- $result .= '</span>';
3078
- }
3079
-
3080
- $endresult .= $result;
3081
- unset($part, $parts[$key], $result);
3082
- }
3083
-
3084
- //This fix is related to SF#1923020, but has to be applied regardless of
3085
- //actually highlighting symbols.
3086
- /** NOTE: memorypeak #3 */
3087
- $endresult = str_replace(array('<SEMI>', '<PIPE>'), array(';', '|'), $endresult);
3088
-
3089
- // // Parse the last stuff (redundant?)
3090
- // $result .= $this->parse_non_string_part($stuff_to_parse);
3091
-
3092
- // Lop off the very first and last spaces
3093
- // $result = substr($result, 1, -1);
3094
-
3095
- // We're finished: stop timing
3096
- $this->set_time($start_time, microtime());
3097
-
3098
- $this->finalise($endresult);
3099
- return $endresult;
3100
- }
3101
-
3102
- /**
3103
- * Swaps out spaces and tabs for HTML indentation. Not needed if
3104
- * the code is in a pre block...
3105
- *
3106
- * @param string The source to indent (reference!)
3107
- * @since 1.0.0
3108
- * @access private
3109
- */
3110
- function indent(&$result) {
3111
- /// Replace tabs with the correct number of spaces
3112
- if (false !== strpos($result, "\t")) {
3113
- $lines = explode("\n", $result);
3114
- $result = null;//Save memory while we process the lines individually
3115
- $tab_width = $this->get_real_tab_width();
3116
- $tab_string = '&nbsp;' . str_repeat(' ', $tab_width);
3117
-
3118
- for ($key = 0, $n = count($lines); $key < $n; $key++) {
3119
- $line = $lines[$key];
3120
- if (false === strpos($line, "\t")) {
3121
- continue;
3122
- }
3123
-
3124
- $pos = 0;
3125
- $length = strlen($line);
3126
- $lines[$key] = ''; // reduce memory
3127
-
3128
- $IN_TAG = false;
3129
- for ($i = 0; $i < $length; ++$i) {
3130
- $char = $line[$i];
3131
- // Simple engine to work out whether we're in a tag.
3132
- // If we are we modify $pos. This is so we ignore HTML
3133
- // in the line and only workout the tab replacement
3134
- // via the actual content of the string
3135
- // This test could be improved to include strings in the
3136
- // html so that < or > would be allowed in user's styles
3137
- // (e.g. quotes: '<' '>'; or similar)
3138
- if ($IN_TAG) {
3139
- if ('>' == $char) {
3140
- $IN_TAG = false;
3141
- }
3142
- $lines[$key] .= $char;
3143
- } else if ('<' == $char) {
3144
- $IN_TAG = true;
3145
- $lines[$key] .= '<';
3146
- } else if ('&' == $char) {
3147
- $substr = substr($line, $i + 3, 5);
3148
- $posi = strpos($substr, ';');
3149
- if (false === $posi) {
3150
- ++$pos;
3151
- } else {
3152
- $pos -= $posi+2;
3153
- }
3154
- $lines[$key] .= $char;
3155
- } else if ("\t" == $char) {
3156
- $str = '';
3157
- // OPTIMISE - move $strs out. Make an array:
3158
- // $tabs = array(
3159
- // 1 => '&nbsp;',
3160
- // 2 => '&nbsp; ',
3161
- // 3 => '&nbsp; &nbsp;' etc etc
3162
- // to use instead of building a string every time
3163
- $tab_end_width = $tab_width - ($pos % $tab_width); //Moved out of the look as it doesn't change within the loop
3164
- if (($pos & 1) || 1 == $tab_end_width) {
3165
- $str .= substr($tab_string, 6, $tab_end_width);
3166
- } else {
3167
- $str .= substr($tab_string, 0, $tab_end_width+5);
3168
- }
3169
- $lines[$key] .= $str;
3170
- $pos += $tab_end_width;
3171
-
3172
- if (false === strpos($line, "\t", $i + 1)) {
3173
- $lines[$key] .= substr($line, $i + 1);
3174
- break;
3175
- }
3176
- } else if (0 == $pos && ' ' == $char) {
3177
- $lines[$key] .= '&nbsp;';
3178
- ++$pos;
3179
- } else {
3180
- $lines[$key] .= $char;
3181
- ++$pos;
3182
- }
3183
- }
3184
- }
3185
- $result = implode("\n", $lines);
3186
- unset($lines);//We don't need the lines separated beyond this --- free them!
3187
- }
3188
- // Other whitespace
3189
- // BenBE: Fix to reduce the number of replacements to be done
3190
- $result = preg_replace('/^ /m', '&nbsp;', $result);
3191
- $result = str_replace(' ', ' &nbsp;', $result);
3192
-
3193
- if ($this->line_numbers == GESHI_NO_LINE_NUMBERS && $this->header_type != GESHI_HEADER_PRE_TABLE) {
3194
- if ($this->line_ending === null) {
3195
- $result = nl2br($result);
3196
- } else {
3197
- $result = str_replace("\n", $this->line_ending, $result);
3198
- }
3199
- }
3200
- }
3201
-
3202
- /**
3203
- * Changes the case of a keyword for those languages where a change is asked for
3204
- *
3205
- * @param string The keyword to change the case of
3206
- * @return string The keyword with its case changed
3207
- * @since 1.0.0
3208
- * @access private
3209
- */
3210
- function change_case($instr) {
3211
- switch ($this->language_data['CASE_KEYWORDS']) {
3212
- case GESHI_CAPS_UPPER:
3213
- return strtoupper($instr);
3214
- case GESHI_CAPS_LOWER:
3215
- return strtolower($instr);
3216
- default:
3217
- return $instr;
3218
- }
3219
- }
3220
-
3221
- /**
3222
- * Handles replacements of keywords to include markup and links if requested
3223
- *
3224
- * @param string The keyword to add the Markup to
3225
- * @return The HTML for the match found
3226
- * @since 1.0.8
3227
- * @access private
3228
- *
3229
- * @todo Get rid of ender in keyword links
3230
- */
3231
- function handle_keyword_replace($match) {
3232
- $k = $this->_kw_replace_group;
3233
- $keyword = $match[0];
3234
-
3235
- $before = '';
3236
- $after = '';
3237
-
3238
- if ($this->keyword_links) {
3239
- // Keyword links have been ebabled
3240
-
3241
- if (isset($this->language_data['URLS'][$k]) &&
3242
- $this->language_data['URLS'][$k] != '') {
3243
- // There is a base group for this keyword
3244
-
3245
- // Old system: strtolower
3246
- //$keyword = ( $this->language_data['CASE_SENSITIVE'][$group] ) ? $keyword : strtolower($keyword);
3247
- // New system: get keyword from language file to get correct case
3248
- if (!$this->language_data['CASE_SENSITIVE'][$k] &&
3249
- strpos($this->language_data['URLS'][$k], '{FNAME}') !== false) {
3250
- foreach ($this->language_data['KEYWORDS'][$k] as $word) {
3251
- if (strcasecmp($word, $keyword) == 0) {
3252
- break;
3253
- }
3254
- }
3255
- } else {
3256
- $word = $keyword;
3257
- }
3258
-
3259
- $before = '<|UR1|"' .
3260
- str_replace(
3261
- array(
3262
- '{FNAME}',
3263
- '{FNAMEL}',
3264
- '{FNAMEU}',
3265
- '.'),
3266
- array(
3267
- str_replace('+', '%20', urlencode($this->hsc($word))),
3268
- str_replace('+', '%20', urlencode($this->hsc(strtolower($word)))),
3269
- str_replace('+', '%20', urlencode($this->hsc(strtoupper($word)))),
3270
- '<DOT>'),
3271
- $this->language_data['URLS'][$k]
3272
- ) . '">';
3273
- $after = '</a>';
3274
- }
3275
- }
3276
-
3277
- return $before . '<|/'. $k .'/>' . $this->change_case($keyword) . '|>' . $after;
3278
- }
3279
-
3280
- /**
3281
- * handles regular expressions highlighting-definitions with callback functions
3282
- *
3283
- * @note this is a callback, don't use it directly
3284
- *
3285
- * @param array the matches array
3286
- * @return The highlighted string
3287
- * @since 1.0.8
3288
- * @access private
3289
- */
3290
- function handle_regexps_callback($matches) {
3291
- // before: "' style=\"' . call_user_func(\"$func\", '\\1') . '\"\\1|>'",
3292
- return ' style="' . call_user_func($this->language_data['STYLES']['REGEXPS'][$this->_rx_key], $matches[1]) . '"'. $matches[1] . '|>';
3293
- }
3294
-
3295
- /**
3296
- * handles newlines in REGEXPS matches. Set the _hmr_* vars before calling this
3297
- *
3298
- * @note this is a callback, don't use it directly
3299
- *
3300
- * @param array the matches array
3301
- * @return string
3302
- * @since 1.0.8
3303
- * @access private
3304
- */
3305
- function handle_multiline_regexps($matches) {
3306
- $before = $this->_hmr_before;
3307
- $after = $this->_hmr_after;
3308
- if ($this->_hmr_replace) {
3309
- $replace = $this->_hmr_replace;
3310
- $search = array();
3311
-
3312
- foreach (array_keys($matches) as $k) {
3313
- $search[] = '\\' . $k;
3314
- }
3315
-
3316
- $before = str_replace($search, $matches, $before);
3317
- $after = str_replace($search, $matches, $after);
3318
- $replace = str_replace($search, $matches, $replace);
3319
- } else {
3320
- $replace = $matches[0];
3321
- }
3322
- return $before
3323
- . '<|!REG3XP' . $this->_hmr_key .'!>'
3324
- . str_replace("\n", "|>\n<|!REG3XP" . $this->_hmr_key . '!>', $replace)
3325
- . '|>'
3326
- . $after;
3327
- }
3328
-
3329
- /**
3330
- * Takes a string that has no strings or comments in it, and highlights
3331
- * stuff like keywords, numbers and methods.
3332
- *
3333
- * @param string The string to parse for keyword, numbers etc.
3334
- * @since 1.0.0
3335
- * @access private
3336
- * @todo BUGGY! Why? Why not build string and return?
3337
- */
3338
- function parse_non_string_part($stuff_to_parse) {
3339
- $stuff_to_parse = ' ' . $this->hsc($stuff_to_parse);
3340
-
3341
- // Highlight keywords
3342
- $disallowed_before = "(?<![a-zA-Z0-9\$_\|\#|^&";
3343
- $disallowed_after = "(?![a-zA-Z0-9_\|%\\-&;";
3344
- if ($this->lexic_permissions['STRINGS']) {
3345
- $quotemarks = preg_quote(implode($this->language_data['QUOTEMARKS']), '/');
3346
- $disallowed_before .= $quotemarks;
3347
- $disallowed_after .= $quotemarks;
3348
- }
3349
- $disallowed_before .= "])";
3350
- $disallowed_after .= "])";
3351
-
3352
- $parser_control_pergroup = false;
3353
- if (isset($this->language_data['PARSER_CONTROL'])) {
3354
- if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'])) {
3355
- $x = 0; // check wether per-keyword-group parser_control is enabled
3356
- if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'])) {
3357
- $disallowed_before = $this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'];
3358
- ++$x;
3359
- }
3360
- if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'])) {
3361
- $disallowed_after = $this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'];
3362
- ++$x;
3363
- }
3364
- $parser_control_pergroup = (count($this->language_data['PARSER_CONTROL']['KEYWORDS']) - $x) > 0;
3365
- }
3366
- }
3367
-
3368
- foreach (array_keys($this->language_data['KEYWORDS']) as $k) {
3369
- if (!isset($this->lexic_permissions['KEYWORDS'][$k]) ||
3370
- $this->lexic_permissions['KEYWORDS'][$k]) {
3371
-
3372
- $case_sensitive = $this->language_data['CASE_SENSITIVE'][$k];
3373
- $modifiers = $case_sensitive ? '' : 'i';
3374
-
3375
- // NEW in 1.0.8 - per-keyword-group parser control
3376
- $disallowed_before_local = $disallowed_before;
3377
- $disallowed_after_local = $disallowed_after;
3378
- if ($parser_control_pergroup && isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k])) {
3379
- if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_BEFORE'])) {
3380
- $disallowed_before_local =
3381
- $this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_BEFORE'];
3382
- }
3383
-
3384
- if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_AFTER'])) {
3385
- $disallowed_after_local =
3386
- $this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_AFTER'];
3387
- }
3388
- }
3389
-
3390
- $this->_kw_replace_group = $k;
3391
-
3392
- //NEW in 1.0.8, the cached regexp list
3393
- // since we don't want PHP / PCRE to crash due to too large patterns we split them into smaller chunks
3394
- for ($set = 0, $set_length = count($this->language_data['CACHED_KEYWORD_LISTS'][$k]); $set < $set_length; ++$set) {
3395
- $keywordset =& $this->language_data['CACHED_KEYWORD_LISTS'][$k][$set];
3396
- // Might make a more unique string for putting the number in soon
3397
- // Basically, we don't put the styles in yet because then the styles themselves will
3398
- // get highlighted if the language has a CSS keyword in it (like CSS, for example ;))
3399
- $stuff_to_parse = preg_replace_callback(
3400
- "/$disallowed_before_local({$keywordset})(?!\<DOT\>(?:htm|php|aspx?))$disallowed_after_local/$modifiers",
3401
- array($this, 'handle_keyword_replace'),
3402
- $stuff_to_parse
3403
- );
3404
- }
3405
- }
3406
- }
3407
-
3408
- // Regular expressions
3409
- foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
3410
- if ($this->lexic_permissions['REGEXPS'][$key]) {
3411
- if (is_array($regexp)) {
3412
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
3413
- // produce valid HTML when we match multiple lines
3414
- $this->_hmr_replace = $regexp[GESHI_REPLACE];
3415
- $this->_hmr_before = $regexp[GESHI_BEFORE];
3416
- $this->_hmr_key = $key;
3417
- $this->_hmr_after = $regexp[GESHI_AFTER];
3418
- $stuff_to_parse = preg_replace_callback(
3419
- "/" . $regexp[GESHI_SEARCH] . "/{$regexp[GESHI_MODIFIERS]}",
3420
- array($this, 'handle_multiline_regexps'),
3421
- $stuff_to_parse);
3422
- $this->_hmr_replace = false;
3423
- $this->_hmr_before = '';
3424
- $this->_hmr_after = '';
3425
- } else {
3426
- $stuff_to_parse = preg_replace(
3427
- '/' . $regexp[GESHI_SEARCH] . '/' . $regexp[GESHI_MODIFIERS],
3428
- $regexp[GESHI_BEFORE] . '<|!REG3XP'. $key .'!>' . $regexp[GESHI_REPLACE] . '|>' . $regexp[GESHI_AFTER],
3429
- $stuff_to_parse);
3430
- }
3431
- } else {
3432
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
3433
- // produce valid HTML when we match multiple lines
3434
- $this->_hmr_key = $key;
3435
- $stuff_to_parse = preg_replace_callback( "/(" . $regexp . ")/",
3436
- array($this, 'handle_multiline_regexps'), $stuff_to_parse);
3437
- $this->_hmr_key = '';
3438
- } else {
3439
- $stuff_to_parse = preg_replace( "/(" . $regexp . ")/", "<|!REG3XP$key!>\\1|>", $stuff_to_parse);
3440
- }
3441
- }
3442
- }
3443
- }
3444
-
3445
- // Highlight numbers. As of 1.0.8 we support different types of numbers
3446
- $numbers_found = false;
3447
-
3448
- if ($this->lexic_permissions['NUMBERS'] && preg_match($this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'], $stuff_to_parse )) {
3449
- $numbers_found = true;
3450
-
3451
- //For each of the formats ...
3452
- foreach($this->language_data['NUMBERS_RXCACHE'] as $id => $regexp) {
3453
- //Check if it should be highlighted ...
3454
- $stuff_to_parse = preg_replace($regexp, "<|/NUM!$id/>\\1|>", $stuff_to_parse);
3455
- }
3456
- }
3457
-
3458
- //
3459
- // Now that's all done, replace /[number]/ with the correct styles
3460
- //
3461
- foreach (array_keys($this->language_data['KEYWORDS']) as $k) {
3462
- if (!$this->use_classes) {
3463
- $attributes = ' style="' .
3464
- (isset($this->language_data['STYLES']['KEYWORDS'][$k]) ?
3465
- $this->language_data['STYLES']['KEYWORDS'][$k] : "") . '"';
3466
- } else {
3467
- $attributes = ' class="kw' . $k . '"';
3468
- }
3469
- $stuff_to_parse = str_replace("<|/$k/>", "<|$attributes>", $stuff_to_parse);
3470
- }
3471
-
3472
- if ($numbers_found) {
3473
- // Put number styles in
3474
- foreach($this->language_data['NUMBERS_RXCACHE'] as $id => $regexp) {
3475
- //Commented out for now, as this needs some review ...
3476
- // if ($numbers_permissions & $id) {
3477
- //Get the appropriate style ...
3478
- //Checking for unset styles is done by the style cache builder ...
3479
- if (!$this->use_classes) {
3480
- $attributes = ' style="' . $this->language_data['STYLES']['NUMBERS'][$id] . '"';
3481
- } else {
3482
- $attributes = ' class="nu'.$id.'"';
3483
- }
3484
-
3485
- //Set in the correct styles ...
3486
- $stuff_to_parse = str_replace("/NUM!$id/", $attributes, $stuff_to_parse);
3487
- // }
3488
- }
3489
- }
3490
-
3491
- // Highlight methods and fields in objects
3492
- if ($this->lexic_permissions['METHODS'] && $this->language_data['OOLANG']) {
3493
- $oolang_spaces = "[\s]*";
3494
- $oolang_before = "";
3495
- $oolang_after = "[a-zA-Z][a-zA-Z0-9_]*";
3496
- if (isset($this->language_data['PARSER_CONTROL'])) {
3497
- if (isset($this->language_data['PARSER_CONTROL']['OOLANG'])) {
3498
- if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_BEFORE'])) {
3499
- $oolang_before = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_BEFORE'];
3500
- }
3501
- if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_AFTER'])) {
3502
- $oolang_after = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_AFTER'];
3503
- }
3504
- if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_SPACES'])) {
3505
- $oolang_spaces = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_SPACES'];
3506
- }
3507
- }
3508
- }
3509
-
3510
- foreach ($this->language_data['OBJECT_SPLITTERS'] as $key => $splitter) {
3511
- if (false !== strpos($stuff_to_parse, $splitter)) {
3512
- if (!$this->use_classes) {
3513
- $attributes = ' style="' . $this->language_data['STYLES']['METHODS'][$key] . '"';
3514
- } else {
3515
- $attributes = ' class="me' . $key . '"';
3516
- }
3517
- $stuff_to_parse = preg_replace("/($oolang_before)(" . preg_quote($this->language_data['OBJECT_SPLITTERS'][$key], '/') . ")($oolang_spaces)($oolang_after)/", "\\1\\2\\3<|$attributes>\\4|>", $stuff_to_parse);
3518
- }
3519
- }
3520
- }
3521
-
3522
- //
3523
- // Highlight brackets. Yes, I've tried adding a semi-colon to this list.
3524
- // You try it, and see what happens ;)
3525
- // TODO: Fix lexic permissions not converting entities if shouldn't
3526
- // be highlighting regardless
3527
- //
3528
- if ($this->lexic_permissions['BRACKETS']) {
3529
- $stuff_to_parse = str_replace( $this->language_data['CACHE_BRACKET_MATCH'],
3530
- $this->language_data['CACHE_BRACKET_REPLACE'], $stuff_to_parse );
3531
- }
3532
-
3533
-
3534
- //FIX for symbol highlighting ...
3535
- if ($this->lexic_permissions['SYMBOLS'] && !empty($this->language_data['SYMBOLS'])) {
3536
- //Get all matches and throw away those witin a block that is already highlighted... (i.e. matched by a regexp)
3537
- $n_symbols = preg_match_all("/<\|(?:<DOT>|[^>])+>(?:(?!\|>).*?)\|>|<\/a>|(?:" . $this->language_data['SYMBOL_SEARCH'] . ")+(?![^<]+?>)/", $stuff_to_parse, $pot_symbols, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
3538
- $global_offset = 0;
3539
- for ($s_id = 0; $s_id < $n_symbols; ++$s_id) {
3540
- $symbol_match = $pot_symbols[$s_id][0][0];
3541
- if (strpos($symbol_match, '<') !== false || strpos($symbol_match, '>') !== false) {
3542
- // already highlighted blocks _must_ include either < or >
3543
- // so if this conditional applies, we have to skip this match
3544
- // BenBE: UNLESS the block contains <SEMI> or <PIPE>
3545
- if(strpos($symbol_match, '<SEMI>') === false &&
3546
- strpos($symbol_match, '<PIPE>') === false) {
3547
- continue;
3548
- }
3549
- }
3550
-
3551
- // if we reach this point, we have a valid match which needs to be highlighted
3552
-
3553
- $symbol_length = strlen($symbol_match);
3554
- $symbol_offset = $pot_symbols[$s_id][0][1];
3555
- unset($pot_symbols[$s_id]);
3556
- $symbol_end = $symbol_length + $symbol_offset;
3557
- $symbol_hl = "";
3558
-
3559
- // if we have multiple styles, we have to handle them properly
3560
- if ($this->language_data['MULTIPLE_SYMBOL_GROUPS']) {
3561
- $old_sym = -1;
3562
- // Split the current stuff to replace into its atomic symbols ...
3563
- preg_match_all("/" . $this->language_data['SYMBOL_SEARCH'] . "/", $symbol_match, $sym_match_syms, PREG_PATTERN_ORDER);
3564
- foreach ($sym_match_syms[0] as $sym_ms) {
3565
- //Check if consequtive symbols belong to the same group to save output ...
3566
- if (isset($this->language_data['SYMBOL_DATA'][$sym_ms])
3567
- && ($this->language_data['SYMBOL_DATA'][$sym_ms] != $old_sym)) {
3568
- if (-1 != $old_sym) {
3569
- $symbol_hl .= "|>";
3570
- }
3571
- $old_sym = $this->language_data['SYMBOL_DATA'][$sym_ms];
3572
- if (!$this->use_classes) {
3573
- $symbol_hl .= '<| style="' . $this->language_data['STYLES']['SYMBOLS'][$old_sym] . '">';
3574
- } else {
3575
- $symbol_hl .= '<| class="sy' . $old_sym . '">';
3576
- }
3577
- }
3578
- $symbol_hl .= $sym_ms;
3579
- }
3580
- unset($sym_match_syms);
3581
-
3582
- //Close remaining tags and insert the replacement at the right position ...
3583
- //Take caution if symbol_hl is empty to avoid doubled closing spans.
3584
- if (-1 != $old_sym) {
3585
- $symbol_hl .= "|>";
3586
- }
3587
- } else {
3588
- if (!$this->use_classes) {
3589
- $symbol_hl = '<| style="' . $this->language_data['STYLES']['SYMBOLS'][0] . '">';
3590
- } else {
3591
- $symbol_hl = '<| class="sy0">';
3592
- }
3593
- $symbol_hl .= $symbol_match . '|>';
3594
- }
3595
-
3596
- $stuff_to_parse = substr_replace($stuff_to_parse, $symbol_hl, $symbol_offset + $global_offset, $symbol_length);
3597
-
3598
- // since we replace old text with something of different size,
3599
- // we'll have to keep track of the differences
3600
- $global_offset += strlen($symbol_hl) - $symbol_length;
3601
- }
3602
- }
3603
- //FIX for symbol highlighting ...
3604
-
3605
- // Add class/style for regexps
3606
- foreach (array_keys($this->language_data['REGEXPS']) as $key) {
3607
- if ($this->lexic_permissions['REGEXPS'][$key]) {
3608
- if (is_callable($this->language_data['STYLES']['REGEXPS'][$key])) {
3609
- $this->_rx_key = $key;
3610
- $stuff_to_parse = preg_replace_callback("/!REG3XP$key!(.*)\|>/U",
3611
- array($this, 'handle_regexps_callback'),
3612
- $stuff_to_parse);
3613
- } else {
3614
- if (!$this->use_classes) {
3615
- $attributes = ' style="' . $this->language_data['STYLES']['REGEXPS'][$key] . '"';
3616
- } else {
3617
- if (is_array($this->language_data['REGEXPS'][$key]) &&
3618
- array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$key])) {
3619
- $attributes = ' class="' .
3620
- $this->language_data['REGEXPS'][$key][GESHI_CLASS] . '"';
3621
- } else {
3622
- $attributes = ' class="re' . $key . '"';
3623
- }
3624
- }
3625
- $stuff_to_parse = str_replace("!REG3XP$key!", "$attributes", $stuff_to_parse);
3626
- }
3627
- }
3628
- }
3629
-
3630
- // Replace <DOT> with . for urls
3631
- $stuff_to_parse = str_replace('<DOT>', '.', $stuff_to_parse);
3632
- // Replace <|UR1| with <a href= for urls also
3633
- if (isset($this->link_styles[GESHI_LINK])) {
3634
- if ($this->use_classes) {
3635
- $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' href=', $stuff_to_parse);
3636
- } else {
3637
- $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' style="' . $this->link_styles[GESHI_LINK] . '" href=', $stuff_to_parse);
3638
- }
3639
- } else {
3640
- $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' href=', $stuff_to_parse);
3641
- }
3642
-
3643
- //
3644
- // NOW we add the span thingy ;)
3645
- //
3646
-
3647
- $stuff_to_parse = str_replace('<|', '<span', $stuff_to_parse);
3648
- $stuff_to_parse = str_replace ( '|>', '</span>', $stuff_to_parse );
3649
- return substr($stuff_to_parse, 1);
3650
- }
3651
-
3652
- /**
3653
- * Sets the time taken to parse the code
3654
- *
3655
- * @param microtime The time when parsing started
3656
- * @param microtime The time when parsing ended
3657
- * @since 1.0.2
3658
- * @access private
3659
- */
3660
- function set_time($start_time, $end_time) {
3661
- $start = explode(' ', $start_time);
3662
- $end = explode(' ', $end_time);
3663
- $this->time = $end[0] + $end[1] - $start[0] - $start[1];
3664
- }
3665
-
3666
- /**
3667
- * Gets the time taken to parse the code
3668
- *
3669
- * @return double The time taken to parse the code
3670
- * @since 1.0.2
3671
- */
3672
- function get_time() {
3673
- return $this->time;
3674
- }
3675
-
3676
- /**
3677
- * Merges arrays recursively, overwriting values of the first array with values of later arrays
3678
- *
3679
- * @since 1.0.8
3680
- * @access private
3681
- */
3682
- function merge_arrays() {
3683
- $arrays = func_get_args();
3684
- $narrays = count($arrays);
3685
-
3686
- // check arguments
3687
- // comment out if more performance is necessary (in this case the foreach loop will trigger a warning if the argument is not an array)
3688
- for ($i = 0; $i < $narrays; $i ++) {
3689
- if (!is_array($arrays[$i])) {
3690
- // also array_merge_recursive returns nothing in this case
3691
- trigger_error('Argument #' . ($i+1) . ' is not an array - trying to merge array with scalar! Returning false!', E_USER_WARNING);
3692
- return false;
3693
- }
3694
- }
3695
-
3696
- // the first array is in the output set in every case
3697
- $ret = $arrays[0];
3698
-
3699
- // merege $ret with the remaining arrays
3700
- for ($i = 1; $i < $narrays; $i ++) {
3701
- foreach ($arrays[$i] as $key => $value) {
3702
- if (is_array($value) && isset($ret[$key])) {
3703
- // if $ret[$key] is not an array you try to merge an scalar value with an array - the result is not defined (incompatible arrays)
3704
- // in this case the call will trigger an E_USER_WARNING and the $ret[$key] will be false.
3705
- $ret[$key] = $this->merge_arrays($ret[$key], $value);
3706
- } else {
3707
- $ret[$key] = $value;
3708
- }
3709
- }
3710
- }
3711
-
3712
- return $ret;
3713
- }
3714
-
3715
- /**
3716
- * Gets language information and stores it for later use
3717
- *
3718
- * @param string The filename of the language file you want to load
3719
- * @since 1.0.0
3720
- * @access private
3721
- * @todo Needs to load keys for lexic permissions for keywords, regexps etc
3722
- */
3723
- function load_language($file_name) {
3724
- if ($file_name == $this->loaded_language) {
3725
- // this file is already loaded!
3726
- return;
3727
- }
3728
-
3729
- //Prepare some stuff before actually loading the language file
3730
- $this->loaded_language = $file_name;
3731
- $this->parse_cache_built = false;
3732
- $this->enable_highlighting();
3733
- $language_data = array();
3734
-
3735
- //Load the language file
3736
- require $file_name;
3737
-
3738
- // Perhaps some checking might be added here later to check that
3739
- // $language data is a valid thing but maybe not
3740
- $this->language_data = $language_data;
3741
-
3742
- // Set strict mode if should be set
3743
- $this->strict_mode = $this->language_data['STRICT_MODE_APPLIES'];
3744
-
3745
- // Set permissions for all lexics to true
3746
- // so they'll be highlighted by default
3747
- foreach (array_keys($this->language_data['KEYWORDS']) as $key) {
3748
- if (!empty($this->language_data['KEYWORDS'][$key])) {
3749
- $this->lexic_permissions['KEYWORDS'][$key] = true;
3750
- } else {
3751
- $this->lexic_permissions['KEYWORDS'][$key] = false;
3752
- }
3753
- }
3754
-
3755
- foreach (array_keys($this->language_data['COMMENT_SINGLE']) as $key) {
3756
- $this->lexic_permissions['COMMENTS'][$key] = true;
3757
- }
3758
- foreach (array_keys($this->language_data['REGEXPS']) as $key) {
3759
- $this->lexic_permissions['REGEXPS'][$key] = true;
3760
- }
3761
-
3762
- // for BenBE and future code reviews:
3763
- // we can use empty here since we only check for existance and emptiness of an array
3764
- // if it is not an array at all but rather false or null this will work as intended as well
3765
- // even if $this->language_data['PARSER_CONTROL'] is undefined this won't trigger a notice
3766
- if (!empty($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'])) {
3767
- foreach ($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'] as $flag => $value) {
3768
- // it's either true or false and maybe is true as well
3769
- $perm = $value !== GESHI_NEVER;
3770
- if ($flag == 'ALL') {
3771
- $this->enable_highlighting($perm);
3772
- continue;
3773
- }
3774
- if (!isset($this->lexic_permissions[$flag])) {
3775
- // unknown lexic permission
3776
- continue;
3777
- }
3778
- if (is_array($this->lexic_permissions[$flag])) {
3779
- foreach ($this->lexic_permissions[$flag] as $key => $val) {
3780
- $this->lexic_permissions[$flag][$key] = $perm;
3781
- }
3782
- } else {
3783
- $this->lexic_permissions[$flag] = $perm;
3784
- }
3785
- }
3786
- unset($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS']);
3787
- }
3788
-
3789
- //Fix: Problem where hardescapes weren't handled if no ESCAPE_CHAR was given
3790
- //You need to set one for HARDESCAPES only in this case.
3791
- if(!isset($this->language_data['HARDCHAR'])) {
3792
- $this->language_data['HARDCHAR'] = $this->language_data['ESCAPE_CHAR'];
3793
- }
3794
-
3795
- //NEW in 1.0.8: Allow styles to be loaded from a separate file to override defaults
3796
- $style_filename = substr($file_name, 0, -4) . '.style.php';
3797
- if (is_readable($style_filename)) {
3798
- //Clear any style_data that could have been set before ...
3799
- if (isset($style_data)) {
3800
- unset($style_data);
3801
- }
3802
-
3803
- //Read the Style Information from the style file
3804
- include $style_filename;
3805
-
3806
- //Apply the new styles to our current language styles
3807
- if (isset($style_data) && is_array($style_data)) {
3808
- $this->language_data['STYLES'] =
3809
- $this->merge_arrays($this->language_data['STYLES'], $style_data);
3810
- }
3811
- }
3812
- }
3813
-
3814
- /**
3815
- * Takes the parsed code and various options, and creates the HTML
3816
- * surrounding it to make it look nice.
3817
- *
3818
- * @param string The code already parsed (reference!)
3819
- * @since 1.0.0
3820
- * @access private
3821
- */
3822
- function finalise(&$parsed_code) {
3823
- // Remove end parts of important declarations
3824
- // This is BUGGY!! My fault for bad code: fix coming in 1.2
3825
- // @todo Remove this crap
3826
- if ($this->enable_important_blocks &&
3827
- (strpos($parsed_code, $this->hsc(GESHI_START_IMPORTANT)) === false)) {
3828
- $parsed_code = str_replace($this->hsc(GESHI_END_IMPORTANT), '', $parsed_code);
3829
- }
3830
-
3831
- // Add HTML whitespace stuff if we're using the <div> header
3832
- if ($this->header_type != GESHI_HEADER_PRE && $this->header_type != GESHI_HEADER_PRE_VALID) {
3833
- $this->indent($parsed_code);
3834
- }
3835
-
3836
- // purge some unnecessary stuff
3837
- /** NOTE: memorypeak #1 */
3838
- $parsed_code = preg_replace('#<span[^>]+>(\s*)</span>#', '\\1', $parsed_code);
3839
-
3840
- // If we are using IDs for line numbers, there needs to be an overall
3841
- // ID set to prevent collisions.
3842
- if ($this->add_ids && !$this->overall_id) {
3843
- $this->overall_id = 'geshi-' . substr(md5(microtime()), 0, 4);
3844
- }
3845
-
3846
- // Get code into lines
3847
- /** NOTE: memorypeak #2 */
3848
- $code = explode("\n", $parsed_code);
3849
- $parsed_code = $this->header();
3850
-
3851
- // If we're using line numbers, we insert <li>s and appropriate
3852
- // markup to style them (otherwise we don't need to do anything)
3853
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS && $this->header_type != GESHI_HEADER_PRE_TABLE) {
3854
- // If we're using the <pre> header, we shouldn't add newlines because
3855
- // the <pre> will line-break them (and the <li>s already do this for us)
3856
- $ls = ($this->header_type != GESHI_HEADER_PRE && $this->header_type != GESHI_HEADER_PRE_VALID) ? "\n" : '';
3857
-
3858
- // Set vars to defaults for following loop
3859
- $i = 0;
3860
-
3861
- // Foreach line...
3862
- for ($i = 0, $n = count($code); $i < $n;) {
3863
- //Reset the attributes for a new line ...
3864
- $attrs = array();
3865
-
3866
- // Make lines have at least one space in them if they're empty
3867
- // BenBE: Checking emptiness using trim instead of relying on blanks
3868
- if ('' == trim($code[$i])) {
3869
- $code[$i] = '&nbsp;';
3870
- }
3871
-
3872
- // If this is a "special line"...
3873
- if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS &&
3874
- $i % $this->line_nth_row == ($this->line_nth_row - 1)) {
3875
- // Set the attributes to style the line
3876
- if ($this->use_classes) {
3877
- //$attr = ' class="li2"';
3878
- $attrs['class'][] = 'li2';
3879
- $def_attr = ' class="de2"';
3880
- } else {
3881
- //$attr = ' style="' . $this->line_style2 . '"';
3882
- $attrs['style'][] = $this->line_style2;
3883
- // This style "covers up" the special styles set for special lines
3884
- // so that styles applied to special lines don't apply to the actual
3885
- // code on that line
3886
- $def_attr = ' style="' . $this->code_style . '"';
3887
- }
3888
- } else {
3889
- if ($this->use_classes) {
3890
- //$attr = ' class="li1"';
3891
- $attrs['class'][] = 'li1';
3892
- $def_attr = ' class="de1"';
3893
- } else {
3894
- //$attr = ' style="' . $this->line_style1 . '"';
3895
- $attrs['style'][] = $this->line_style1;
3896
- $def_attr = ' style="' . $this->code_style . '"';
3897
- }
3898
- }
3899
-
3900
- //Check which type of tag to insert for this line
3901
- if ($this->header_type == GESHI_HEADER_PRE_VALID) {
3902
- $start = "<pre$def_attr>";
3903
- $end = '</pre>';
3904
- } else {
3905
- // Span or div?
3906
- $start = "<div$def_attr>";
3907
- $end = '</div>';
3908
- }
3909
-
3910
- ++$i;
3911
-
3912
- // Are we supposed to use ids? If so, add them
3913
- if ($this->add_ids) {
3914
- $attrs['id'][] = "$this->overall_id-$i";
3915
- }
3916
-
3917
- //Is this some line with extra styles???
3918
- if (in_array($i, $this->highlight_extra_lines)) {
3919
- if ($this->use_classes) {
3920
- if (isset($this->highlight_extra_lines_styles[$i])) {
3921
- $attrs['class'][] = "lx$i";
3922
- } else {
3923
- $attrs['class'][] = "ln-xtra";
3924
- }
3925
- } else {
3926
- array_push($attrs['style'], $this->get_line_style($i));
3927
- }
3928
- }
3929
-
3930
- // Add in the line surrounded by appropriate list HTML
3931
- $attr_string = '';
3932
- foreach ($attrs as $key => $attr) {
3933
- $attr_string .= ' ' . $key . '="' . implode(' ', $attr) . '"';
3934
- }
3935
-
3936
- $parsed_code .= "<li$attr_string>$start{$code[$i-1]}$end</li>$ls";
3937
- unset($code[$i - 1]);
3938
- }
3939
- } else {
3940
- $n = count($code);
3941
- if ($this->use_classes) {
3942
- $attributes = ' class="de1"';
3943
- } else {
3944
- $attributes = ' style="'. $this->code_style .'"';
3945
- }
3946
- if ($this->header_type == GESHI_HEADER_PRE_VALID) {
3947
- $parsed_code .= '<pre'. $attributes .'>';
3948
- } elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) {
3949
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
3950
- if ($this->use_classes) {
3951
- $attrs = ' class="ln"';
3952
- } else {
3953
- $attrs = ' style="'. $this->table_linenumber_style .'"';
3954
- }
3955
- $parsed_code .= '<td'.$attrs.'><pre'.$attributes.'>';
3956
- // get linenumbers
3957
- // we don't merge it with the for below, since it should be better for
3958
- // memory consumption this way
3959
- // @todo: but... actually it would still be somewhat nice to merge the two loops
3960
- // the mem peaks are at different positions
3961
- for ($i = 0; $i < $n; ++$i) {
3962
- $close = 0;
3963
- // fancy lines
3964
- if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS &&
3965
- $i % $this->line_nth_row == ($this->line_nth_row - 1)) {
3966
- // Set the attributes to style the line
3967
- if ($this->use_classes) {
3968
- $parsed_code .= '<span class="xtra li2"><span class="de2">';
3969
- } else {
3970
- // This style "covers up" the special styles set for special lines
3971
- // so that styles applied to special lines don't apply to the actual
3972
- // code on that line
3973
- $parsed_code .= '<span style="display:block;' . $this->line_style2 . '">'
3974
- .'<span style="' . $this->code_style .'">';
3975
- }
3976
- $close += 2;
3977
- }
3978
- //Is this some line with extra styles???
3979
- if (in_array($i + 1, $this->highlight_extra_lines)) {
3980
- if ($this->use_classes) {
3981
- if (isset($this->highlight_extra_lines_styles[$i])) {
3982
- $parsed_code .= "<span class=\"xtra lx$i\">";
3983
- } else {
3984
- $parsed_code .= "<span class=\"xtra ln-xtra\">";
3985
- }
3986
- } else {
3987
- $parsed_code .= "<span style=\"display:block;" . $this->get_line_style($i) . "\">";
3988
- }
3989
- ++$close;
3990
- }
3991
- $parsed_code .= $this->line_numbers_start + $i;
3992
- if ($close) {
3993
- $parsed_code .= str_repeat('</span>', $close);
3994
- } else if ($i != $n) {
3995
- $parsed_code .= "\n";
3996
- }
3997
- }
3998
- $parsed_code .= '</pre></td><td'.$attributes.'>';
3999
- }
4000
- $parsed_code .= '<pre'. $attributes .'>';
4001
- }
4002
- // No line numbers, but still need to handle highlighting lines extra.
4003
- // Have to use divs so the full width of the code is highlighted
4004
- $close = 0;
4005
- for ($i = 0; $i < $n; ++$i) {
4006
- // Make lines have at least one space in them if they're empty
4007
- // BenBE: Checking emptiness using trim instead of relying on blanks
4008
- if ('' == trim($code[$i])) {
4009
- $code[$i] = '&nbsp;';
4010
- }
4011
- // fancy lines
4012
- if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS &&
4013
- $i % $this->line_nth_row == ($this->line_nth_row - 1)) {
4014
- // Set the attributes to style the line
4015
- if ($this->use_classes) {
4016
- $parsed_code .= '<span class="xtra li2"><span class="de2">';
4017
- } else {
4018
- // This style "covers up" the special styles set for special lines
4019
- // so that styles applied to special lines don't apply to the actual
4020
- // code on that line
4021
- $parsed_code .= '<span style="display:block;' . $this->line_style2 . '">'
4022
- .'<span style="' . $this->code_style .'">';
4023
- }
4024
- $close += 2;
4025
- }
4026
- //Is this some line with extra styles???
4027
- if (in_array($i + 1, $this->highlight_extra_lines)) {
4028
- if ($this->use_classes) {
4029
- if (isset($this->highlight_extra_lines_styles[$i])) {
4030
- $parsed_code .= "<span class=\"xtra lx$i\">";
4031
- } else {
4032
- $parsed_code .= "<span class=\"xtra ln-xtra\">";
4033
- }
4034
- } else {
4035
- $parsed_code .= "<span style=\"display:block;" . $this->get_line_style($i) . "\">";
4036
- }
4037
- ++$close;
4038
- }
4039
-
4040
- $parsed_code .= $code[$i];
4041
-
4042
- if ($close) {
4043
- $parsed_code .= str_repeat('</span>', $close);
4044
- $close = 0;
4045
- }
4046
- elseif ($i + 1 < $n) {
4047
- $parsed_code .= "\n";
4048
- }
4049
- unset($code[$i]);
4050
- }
4051
-
4052
- if ($this->header_type == GESHI_HEADER_PRE_VALID || $this->header_type == GESHI_HEADER_PRE_TABLE) {
4053
- $parsed_code .= '</pre>';
4054
- }
4055
- if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
4056
- $parsed_code .= '</td>';
4057
- }
4058
- }
4059
-
4060
- $parsed_code .= $this->footer();
4061
- }
4062
-
4063
- /**
4064
- * Creates the header for the code block (with correct attributes)
4065
- *
4066
- * @return string The header for the code block
4067
- * @since 1.0.0
4068
- * @access private
4069
- */
4070
- function header() {
4071
- // Get attributes needed
4072
- /**
4073
- * @todo Document behaviour change - class is outputted regardless of whether
4074
- * we're using classes or not. Same with style
4075
- */
4076
- $attributes = ' class="' . $this->_genCSSName($this->language);
4077
- if ($this->overall_class != '') {
4078
- $attributes .= " ".$this->_genCSSName($this->overall_class);
4079
- }
4080
- $attributes .= '"';
4081
-
4082
- if ($this->overall_id != '') {
4083
- $attributes .= " id=\"{$this->overall_id}\"";
4084
- }
4085
- if ($this->overall_style != '' && !$this->use_classes) {
4086
- $attributes .= ' style="' . $this->overall_style . '"';
4087
- }
4088
-
4089
- $ol_attributes = '';
4090
-
4091
- if ($this->line_numbers_start != 1) {
4092
- $ol_attributes .= ' start="' . $this->line_numbers_start . '"';
4093
- }
4094
-
4095
- // Get the header HTML
4096
- $header = $this->header_content;
4097
- if ($header) {
4098
- if ($this->header_type == GESHI_HEADER_PRE || $this->header_type == GESHI_HEADER_PRE_VALID) {
4099
- $header = str_replace("\n", '', $header);
4100
- }
4101
- $header = $this->replace_keywords($header);
4102
-
4103
- if ($this->use_classes) {
4104
- $attr = ' class="head"';
4105
- } else {
4106
- $attr = " style=\"{$this->header_content_style}\"";
4107
- }
4108
- if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
4109
- $header = "<thead><tr><td colspan=\"2\" $attr>$header</td></tr></thead>";
4110
- } else {
4111
- $header = "<div$attr>$header</div>";
4112
- }
4113
- }
4114
-
4115
- if (GESHI_HEADER_NONE == $this->header_type) {
4116
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
4117
- return "$header<ol$attributes$ol_attributes>";
4118
- }
4119
- return $header . ($this->force_code_block ? '<div>' : '');
4120
- }
4121
-
4122
- // Work out what to return and do it
4123
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
4124
- if ($this->header_type == GESHI_HEADER_PRE) {
4125
- return "<pre$attributes>$header<ol$ol_attributes>";
4126
- } else if ($this->header_type == GESHI_HEADER_DIV ||
4127
- $this->header_type == GESHI_HEADER_PRE_VALID) {
4128
- return "<div$attributes>$header<ol$ol_attributes>";
4129
- } else if ($this->header_type == GESHI_HEADER_PRE_TABLE) {
4130
- return "<table$attributes>$header<tbody><tr class=\"li1\">";
4131
- }
4132
- } else {
4133
- if ($this->header_type == GESHI_HEADER_PRE) {
4134
- return "<pre$attributes>$header" .
4135
- ($this->force_code_block ? '<div>' : '');
4136
- } else {
4137
- return "<div$attributes>$header" .
4138
- ($this->force_code_block ? '<div>' : '');
4139
- }
4140
- }
4141
- }
4142
-
4143
- /**
4144
- * Returns the footer for the code block.
4145
- *
4146
- * @return string The footer for the code block
4147
- * @since 1.0.0
4148
- * @access private
4149
- */
4150
- function footer() {
4151
- $footer = $this->footer_content;
4152
- if ($footer) {
4153
- if ($this->header_type == GESHI_HEADER_PRE) {
4154
- $footer = str_replace("\n", '', $footer);;
4155
- }
4156
- $footer = $this->replace_keywords($footer);
4157
-
4158
- if ($this->use_classes) {
4159
- $attr = ' class="foot"';
4160
- } else {
4161
- $attr = " style=\"{$this->footer_content_style}\"";
4162
- }
4163
- if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
4164
- $footer = "<tfoot><tr><td colspan=\"2\">$footer</td></tr></tfoot>";
4165
- } else {
4166
- $footer = "<div$attr>$footer</div>";
4167
- }
4168
- }
4169
-
4170
- if (GESHI_HEADER_NONE == $this->header_type) {
4171
- return ($this->line_numbers != GESHI_NO_LINE_NUMBERS) ? '</ol>' . $footer : $footer;
4172
- }
4173
-
4174
- if ($this->header_type == GESHI_HEADER_DIV || $this->header_type == GESHI_HEADER_PRE_VALID) {
4175
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
4176
- return "</ol>$footer</div>";
4177
- }
4178
- return ($this->force_code_block ? '</div>' : '') .
4179
- "$footer</div>";
4180
- }
4181
- elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) {
4182
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
4183
- return "</tr></tbody>$footer</table>";
4184
- }
4185
- return ($this->force_code_block ? '</div>' : '') .
4186
- "$footer</div>";
4187
- }
4188
- else {
4189
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
4190
- return "</ol>$footer</pre>";
4191
- }
4192
- return ($this->force_code_block ? '</div>' : '') .
4193
- "$footer</pre>";
4194
- }
4195
- }
4196
-
4197
- /**
4198
- * Replaces certain keywords in the header and footer with
4199
- * certain configuration values
4200
- *
4201
- * @param string The header or footer content to do replacement on
4202
- * @return string The header or footer with replaced keywords
4203
- * @since 1.0.2
4204
- * @access private
4205
- */
4206
- function replace_keywords($instr) {
4207
- $keywords = $replacements = array();
4208
-
4209
- $keywords[] = '<TIME>';
4210
- $keywords[] = '{TIME}';
4211
- $replacements[] = $replacements[] = number_format($time = $this->get_time(), 3);
4212
-
4213
- $keywords[] = '<LANGUAGE>';
4214
- $keywords[] = '{LANGUAGE}';
4215
- $replacements[] = $replacements[] = $this->language_data['LANG_NAME'];
4216
-
4217
- $keywords[] = '<VERSION>';
4218
- $keywords[] = '{VERSION}';
4219
- $replacements[] = $replacements[] = GESHI_VERSION;
4220
-
4221
- $keywords[] = '<SPEED>';
4222
- $keywords[] = '{SPEED}';
4223
- if ($time <= 0) {
4224
- $speed = 'N/A';
4225
- } else {
4226
- $speed = strlen($this->source) / $time;
4227
- if ($speed >= 1024) {
4228
- $speed = sprintf("%.2f KB/s", $speed / 1024.0);
4229
- } else {
4230
- $speed = sprintf("%.0f B/s", $speed);
4231
- }
4232
- }
4233
- $replacements[] = $replacements[] = $speed;
4234
-
4235
- return str_replace($keywords, $replacements, $instr);
4236
- }
4237
-
4238
- /**
4239
- * Secure replacement for PHP built-in function htmlspecialchars().
4240
- *
4241
- * See ticket #427 (http://wush.net/trac/wikka/ticket/427) for the rationale
4242
- * for this replacement function.
4243
- *
4244
- * The INTERFACE for this function is almost the same as that for
4245
- * htmlspecialchars(), with the same default for quote style; however, there
4246
- * is no 'charset' parameter. The reason for this is as follows:
4247
- *
4248
- * The PHP docs say:
4249
- * "The third argument charset defines character set used in conversion."
4250
- *
4251
- * I suspect PHP's htmlspecialchars() is working at the byte-value level and
4252
- * thus _needs_ to know (or asssume) a character set because the special
4253
- * characters to be replaced could exist at different code points in
4254
- * different character sets. (If indeed htmlspecialchars() works at
4255
- * byte-value level that goes some way towards explaining why the
4256
- * vulnerability would exist in this function, too, and not only in
4257
- * htmlentities() which certainly is working at byte-value level.)
4258
- *
4259
- * This replacement function however works at character level and should
4260
- * therefore be "immune" to character set differences - so no charset
4261
- * parameter is needed or provided. If a third parameter is passed, it will
4262
- * be silently ignored.
4263
- *
4264
- * In the OUTPUT there is a minor difference in that we use '&#39;' instead
4265
- * of PHP's '&#039;' for a single quote: this provides compatibility with
4266
- * get_html_translation_table(HTML_SPECIALCHARS, ENT_QUOTES)
4267
- * (see comment by mikiwoz at yahoo dot co dot uk on
4268
- * http://php.net/htmlspecialchars); it also matches the entity definition
4269
- * for XML 1.0
4270
- * (http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters).
4271
- * Like PHP we use a numeric character reference instead of '&apos;' for the
4272
- * single quote. For the other special characters we use the named entity
4273
- * references, as PHP is doing.
4274
- *
4275
- * @author {@link http://wikkawiki.org/JavaWoman Marjolein Katsma}
4276
- *
4277
- * @license http://www.gnu.org/copyleft/lgpl.html
4278
- * GNU Lesser General Public License
4279
- * @copyright Copyright 2007, {@link http://wikkawiki.org/CreditsPage
4280
- * Wikka Development Team}
4281
- *
4282
- * @access private
4283
- * @param string $string string to be converted
4284
- * @param integer $quote_style
4285
- * - ENT_COMPAT: escapes &, <, > and double quote (default)
4286
- * - ENT_NOQUOTES: escapes only &, < and >
4287
- * - ENT_QUOTES: escapes &, <, >, double and single quotes
4288
- * @return string converted string
4289
- * @since 1.0.7.18
4290
- */
4291
- function hsc($string, $quote_style = ENT_COMPAT) {
4292
- // init
4293
- static $aTransSpecchar = array(
4294
- '&' => '&amp;',
4295
- '"' => '&quot;',
4296
- '<' => '&lt;',
4297
- '>' => '&gt;',
4298
-
4299
- //This fix is related to SF#1923020, but has to be applied
4300
- //regardless of actually highlighting symbols.
4301
-
4302
- //Circumvent a bug with symbol highlighting
4303
- //This is required as ; would produce undesirable side-effects if it
4304
- //was not to be processed as an entity.
4305
- ';' => '<SEMI>', // Force ; to be processed as entity
4306
- '|' => '<PIPE>' // Force | to be processed as entity
4307
- ); // ENT_COMPAT set
4308
-
4309
- switch ($quote_style) {
4310
- case ENT_NOQUOTES: // don't convert double quotes
4311
- unset($aTransSpecchar['"']);
4312
- break;
4313
- case ENT_QUOTES: // convert single quotes as well
4314
- $aTransSpecchar["'"] = '&#39;'; // (apos) htmlspecialchars() uses '&#039;'
4315
- break;
4316
- }
4317
-
4318
- // return translated string
4319
- return strtr($string, $aTransSpecchar);
4320
- }
4321
-
4322
- function _genCSSName($name){
4323
- return (is_numeric($name[0]) ? '_' : '') . $name;
4324
- }
4325
-
4326
- /**
4327
- * Returns a stylesheet for the highlighted code. If $economy mode
4328
- * is true, we only return the stylesheet declarations that matter for
4329
- * this code block instead of the whole thing
4330
- *
4331
- * @param boolean Whether to use economy mode or not
4332
- * @return string A stylesheet built on the data for the current language
4333
- * @since 1.0.0
4334
- */
4335
- function get_stylesheet($economy_mode = true) {
4336
- // If there's an error, chances are that the language file
4337
- // won't have populated the language data file, so we can't
4338
- // risk getting a stylesheet...
4339
- if ($this->error) {
4340
- return '';
4341
- }
4342
-
4343
- //Check if the style rearrangements have been processed ...
4344
- //This also does some preprocessing to check which style groups are useable ...
4345
- if(!isset($this->language_data['NUMBERS_CACHE'])) {
4346
- $this->build_style_cache();
4347
- }
4348
-
4349
- // First, work out what the selector should be. If there's an ID,
4350
- // that should be used, the same for a class. Otherwise, a selector
4351
- // of '' means that these styles will be applied anywhere
4352
- if ($this->overall_id) {
4353
- $selector = '#' . $this->_genCSSName($this->overall_id);
4354
- } else {
4355
- $selector = '.' . $this->_genCSSName($this->language);
4356
- if ($this->overall_class) {
4357
- $selector .= '.' . $this->_genCSSName($this->overall_class);
4358
- }
4359
- }
4360
- $selector .= ' ';
4361
-
4362
- // Header of the stylesheet
4363
- if (!$economy_mode) {
4364
- $stylesheet = "/**\n".
4365
- " * GeSHi Dynamically Generated Stylesheet\n".
4366
- " * --------------------------------------\n".
4367
- " * Dynamically generated stylesheet for {$this->language}\n".
4368
- " * CSS class: {$this->overall_class}, CSS id: {$this->overall_id}\n".
4369
- " * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann\n" .
4370
- " * (http://qbnz.com/highlighter/ and http://geshi.org/)\n".
4371
- " * --------------------------------------\n".
4372
- " */\n";
4373
- } else {
4374
- $stylesheet = "/**\n".
4375
- " * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann\n" .
4376
- " * (http://qbnz.com/highlighter/ and http://geshi.org/)\n".
4377
- " */\n";
4378
- }
4379
-
4380
- // Set the <ol> to have no effect at all if there are line numbers
4381
- // (<ol>s have margins that should be destroyed so all layout is
4382
- // controlled by the set_overall_style method, which works on the
4383
- // <pre> or <div> container). Additionally, set default styles for lines
4384
- if (!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
4385
- //$stylesheet .= "$selector, {$selector}ol, {$selector}ol li {margin: 0;}\n";
4386
- $stylesheet .= "$selector.de1, $selector.de2 {{$this->code_style}}\n";
4387
- }
4388
-
4389
- // Add overall styles
4390
- // note: neglect economy_mode, empty styles are meaningless
4391
- if ($this->overall_style != '') {
4392
- $stylesheet .= "$selector {{$this->overall_style}}\n";
4393
- }
4394
-
4395
- // Add styles for links
4396
- // note: economy mode does not make _any_ sense here
4397
- // either the style is empty and thus no selector is needed
4398
- // or the appropriate key is given.
4399
- foreach ($this->link_styles as $key => $style) {
4400
- if ($style != '') {
4401
- switch ($key) {
4402
- case GESHI_LINK:
4403
- $stylesheet .= "{$selector}a:link {{$style}}\n";
4404
- break;
4405
- case GESHI_HOVER:
4406
- $stylesheet .= "{$selector}a:hover {{$style}}\n";
4407
- break;
4408
- case GESHI_ACTIVE:
4409
- $stylesheet .= "{$selector}a:active {{$style}}\n";
4410
- break;
4411
- case GESHI_VISITED:
4412
- $stylesheet .= "{$selector}a:visited {{$style}}\n";
4413
- break;
4414
- }
4415
- }
4416
- }
4417
-
4418
- // Header and footer
4419
- // note: neglect economy_mode, empty styles are meaningless
4420
- if ($this->header_content_style != '') {
4421
- $stylesheet .= "$selector.head {{$this->header_content_style}}\n";
4422
- }
4423
- if ($this->footer_content_style != '') {
4424
- $stylesheet .= "$selector.foot {{$this->footer_content_style}}\n";
4425
- }
4426
-
4427
- // Styles for important stuff
4428
- // note: neglect economy_mode, empty styles are meaningless
4429
- if ($this->important_styles != '') {
4430
- $stylesheet .= "$selector.imp {{$this->important_styles}}\n";
4431
- }
4432
-
4433
- // Simple line number styles
4434
- if ((!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) && $this->line_style1 != '') {
4435
- $stylesheet .= "{$selector}li, {$selector}.li1 {{$this->line_style1}}\n";
4436
- }
4437
- if ((!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) && $this->table_linenumber_style != '') {
4438
- $stylesheet .= "{$selector}.ln {{$this->table_linenumber_style}}\n";
4439
- }
4440
- // If there is a style set for fancy line numbers, echo it out
4441
- if ((!$economy_mode || $this->line_numbers == GESHI_FANCY_LINE_NUMBERS) && $this->line_style2 != '') {
4442
- $stylesheet .= "{$selector}.li2 {{$this->line_style2}}\n";
4443
- }
4444
-
4445
- // note: empty styles are meaningless
4446
- foreach ($this->language_data['STYLES']['KEYWORDS'] as $group => $styles) {
4447
- if ($styles != '' && (!$economy_mode ||
4448
- (isset($this->lexic_permissions['KEYWORDS'][$group]) &&
4449
- $this->lexic_permissions['KEYWORDS'][$group]))) {
4450
- $stylesheet .= "$selector.kw$group {{$styles}}\n";
4451
- }
4452
- }
4453
- foreach ($this->language_data['STYLES']['COMMENTS'] as $group => $styles) {
4454
- if ($styles != '' && (!$economy_mode ||
4455
- (isset($this->lexic_permissions['COMMENTS'][$group]) &&
4456
- $this->lexic_permissions['COMMENTS'][$group]) ||
4457
- (!empty($this->language_data['COMMENT_REGEXP']) &&
4458
- !empty($this->language_data['COMMENT_REGEXP'][$group])))) {
4459
- $stylesheet .= "$selector.co$group {{$styles}}\n";
4460
- }
4461
- }
4462
- foreach ($this->language_data['STYLES']['ESCAPE_CHAR'] as $group => $styles) {
4463
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['ESCAPE_CHAR'])) {
4464
- // NEW: since 1.0.8 we have to handle hardescapes
4465
- if ($group === 'HARD') {
4466
- $group = '_h';
4467
- }
4468
- $stylesheet .= "$selector.es$group {{$styles}}\n";
4469
- }
4470
- }
4471
- foreach ($this->language_data['STYLES']['BRACKETS'] as $group => $styles) {
4472
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['BRACKETS'])) {
4473
- $stylesheet .= "$selector.br$group {{$styles}}\n";
4474
- }
4475
- }
4476
- foreach ($this->language_data['STYLES']['SYMBOLS'] as $group => $styles) {
4477
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['SYMBOLS'])) {
4478
- $stylesheet .= "$selector.sy$group {{$styles}}\n";
4479
- }
4480
- }
4481
- foreach ($this->language_data['STYLES']['STRINGS'] as $group => $styles) {
4482
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['STRINGS'])) {
4483
- // NEW: since 1.0.8 we have to handle hardquotes
4484
- if ($group === 'HARD') {
4485
- $group = '_h';
4486
- }
4487
- $stylesheet .= "$selector.st$group {{$styles}}\n";
4488
- }
4489
- }
4490
- foreach ($this->language_data['STYLES']['NUMBERS'] as $group => $styles) {
4491
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['NUMBERS'])) {
4492
- $stylesheet .= "$selector.nu$group {{$styles}}\n";
4493
- }
4494
- }
4495
- foreach ($this->language_data['STYLES']['METHODS'] as $group => $styles) {
4496
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['METHODS'])) {
4497
- $stylesheet .= "$selector.me$group {{$styles}}\n";
4498
- }
4499
- }
4500
- // note: neglect economy_mode, empty styles are meaningless
4501
- foreach ($this->language_data['STYLES']['SCRIPT'] as $group => $styles) {
4502
- if ($styles != '') {
4503
- $stylesheet .= "$selector.sc$group {{$styles}}\n";
4504
- }
4505
- }
4506
- foreach ($this->language_data['STYLES']['REGEXPS'] as $group => $styles) {
4507
- if ($styles != '' && (!$economy_mode ||
4508
- (isset($this->lexic_permissions['REGEXPS'][$group]) &&
4509
- $this->lexic_permissions['REGEXPS'][$group]))) {
4510
- if (is_array($this->language_data['REGEXPS'][$group]) &&
4511
- array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$group])) {
4512
- $stylesheet .= "$selector.";
4513
- $stylesheet .= $this->language_data['REGEXPS'][$group][GESHI_CLASS];
4514
- $stylesheet .= " {{$styles}}\n";
4515
- } else {
4516
- $stylesheet .= "$selector.re$group {{$styles}}\n";
4517
- }
4518
- }
4519
- }
4520
- // Styles for lines being highlighted extra
4521
- if (!$economy_mode || (count($this->highlight_extra_lines)!=count($this->highlight_extra_lines_styles))) {
4522
- $stylesheet .= "{$selector}.ln-xtra, {$selector}li.ln-xtra, {$selector}div.ln-xtra {{$this->highlight_extra_lines_style}}\n";
4523
- }
4524
- $stylesheet .= "{$selector}span.xtra { display:block; }\n";
4525
- foreach ($this->highlight_extra_lines_styles as $lineid => $linestyle) {
4526
- $stylesheet .= "{$selector}.lx$lineid, {$selector}li.lx$lineid, {$selector}div.lx$lineid {{$linestyle}}\n";
4527
- }
4528
-
4529
- return $stylesheet;
4530
- }
4531
-
4532
- /**
4533
- * Get's the style that is used for the specified line
4534
- *
4535
- * @param int The line number information is requested for
4536
- * @access private
4537
- * @since 1.0.7.21
4538
- */
4539
- function get_line_style($line) {
4540
- //$style = null;
4541
- $style = null;
4542
- if (isset($this->highlight_extra_lines_styles[$line])) {
4543
- $style = $this->highlight_extra_lines_styles[$line];
4544
- } else { // if no "extra" style assigned
4545
- $style = $this->highlight_extra_lines_style;
4546
- }
4547
-
4548
- return $style;
4549
- }
4550
-
4551
- /**
4552
- * this functions creates an optimized regular expression list
4553
- * of an array of strings.
4554
- *
4555
- * Example:
4556
- * <code>$list = array('faa', 'foo', 'foobar');
4557
- * => string 'f(aa|oo(bar)?)'</code>
4558
- *
4559
- * @param $list array of (unquoted) strings
4560
- * @param $regexp_delimiter your regular expression delimiter, @see preg_quote()
4561
- * @return string for regular expression
4562
- * @author Milian Wolff <mail@milianw.de>
4563
- * @since 1.0.8
4564
- * @access private
4565
- */
4566
- function optimize_regexp_list($list, $regexp_delimiter = '/') {
4567
- $regex_chars = array('.', '\\', '+', '-', '*', '?', '[', '^', ']', '$',
4568
- '(', ')', '{', '}', '=', '!', '<', '>', '|', ':', $regexp_delimiter);
4569
- sort($list);
4570
- $regexp_list = array('');
4571
- $num_subpatterns = 0;
4572
- $list_key = 0;
4573
-
4574
- // the tokens which we will use to generate the regexp list
4575
- $tokens = array();
4576
- $prev_keys = array();
4577
- // go through all entries of the list and generate the token list
4578
- $cur_len = 0;
4579
- for ($i = 0, $i_max = count($list); $i < $i_max; ++$i) {
4580
- if ($cur_len > GESHI_MAX_PCRE_LENGTH) {
4581
- // seems like the length of this pcre is growing exorbitantly
4582
- $regexp_list[++$list_key] = $this->_optimize_regexp_list_tokens_to_string($tokens);
4583
- $num_subpatterns = substr_count($regexp_list[$list_key], '(?:');
4584
- $tokens = array();
4585
- $cur_len = 0;
4586
- }
4587
- $level = 0;
4588
- $entry = preg_quote((string) $list[$i], $regexp_delimiter);
4589
- $pointer = &$tokens;
4590
- // properly assign the new entry to the correct position in the token array
4591
- // possibly generate smaller common denominator keys
4592
- while (true) {
4593
- // get the common denominator
4594
- if (isset($prev_keys[$level])) {
4595
- if ($prev_keys[$level] == $entry) {
4596
- // this is a duplicate entry, skip it
4597
- continue 2;
4598
- }
4599
- $char = 0;
4600
- while (isset($entry[$char]) && isset($prev_keys[$level][$char])
4601
- && $entry[$char] == $prev_keys[$level][$char]) {
4602
- ++$char;
4603
- }
4604
- if ($char > 0) {
4605
- // this entry has at least some chars in common with the current key
4606
- if ($char == strlen($prev_keys[$level])) {
4607
- // current key is totally matched, i.e. this entry has just some bits appended
4608
- $pointer = &$pointer[$prev_keys[$level]];
4609
- } else {
4610
- // only part of the keys match
4611
- $new_key_part1 = substr($prev_keys[$level], 0, $char);
4612
- $new_key_part2 = substr($prev_keys[$level], $char);
4613
-
4614
- if (in_array($new_key_part1[0], $regex_chars)
4615
- || in_array($new_key_part2[0], $regex_chars)) {
4616
- // this is bad, a regex char as first character
4617
- $pointer[$entry] = array('' => true);
4618
- array_splice($prev_keys, $level, count($prev_keys), $entry);
4619
- $cur_len += strlen($entry);
4620
- continue;
4621
- } else {
4622
- // relocate previous tokens
4623
- $pointer[$new_key_part1] = array($new_key_part2 => $pointer[$prev_keys[$level]]);
4624
- unset($pointer[$prev_keys[$level]]);
4625
- $pointer = &$pointer[$new_key_part1];
4626
- // recreate key index
4627
- array_splice($prev_keys, $level, count($prev_keys), array($new_key_part1, $new_key_part2));
4628
- $cur_len += strlen($new_key_part2);
4629
- }
4630
- }
4631
- ++$level;
4632
- $entry = substr($entry, $char);
4633
- continue;
4634
- }
4635
- // else: fall trough, i.e. no common denominator was found
4636
- }
4637
- if ($level == 0 && !empty($tokens)) {
4638
- // we can dump current tokens into the string and throw them away afterwards
4639
- $new_entry = $this->_optimize_regexp_list_tokens_to_string($tokens);
4640
- $new_subpatterns = substr_count($new_entry, '(?:');
4641
- if (GESHI_MAX_PCRE_SUBPATTERNS && $num_subpatterns + $new_subpatterns > GESHI_MAX_PCRE_SUBPATTERNS) {
4642
- $regexp_list[++$list_key] = $new_entry;
4643
- $num_subpatterns = $new_subpatterns;
4644
- } else {
4645
- if (!empty($regexp_list[$list_key])) {
4646
- $new_entry = '|' . $new_entry;
4647
- }
4648
- $regexp_list[$list_key] .= $new_entry;
4649
- $num_subpatterns += $new_subpatterns;
4650
- }
4651
- $tokens = array();
4652
- $cur_len = 0;
4653
- }
4654
- // no further common denominator found
4655
- $pointer[$entry] = array('' => true);
4656
- array_splice($prev_keys, $level, count($prev_keys), $entry);
4657
-
4658
- $cur_len += strlen($entry);
4659
- break;
4660
- }
4661
- unset($list[$i]);
4662
- }
4663
- // make sure the last tokens get converted as well
4664
- $new_entry = $this->_optimize_regexp_list_tokens_to_string($tokens);
4665
- if (GESHI_MAX_PCRE_SUBPATTERNS && $num_subpatterns + substr_count($new_entry, '(?:') > GESHI_MAX_PCRE_SUBPATTERNS) {
4666
- if ( !empty($regexp_list[$list_key]) ) {
4667
- ++$list_key;
4668
- }
4669
- $regexp_list[$list_key] = $new_entry;
4670
- } else {
4671
- if (!empty($regexp_list[$list_key])) {
4672
- $new_entry = '|' . $new_entry;
4673
- }
4674
- $regexp_list[$list_key] .= $new_entry;
4675
- }
4676
- return $regexp_list;
4677
- }
4678
- /**
4679
- * this function creates the appropriate regexp string of an token array
4680
- * you should not call this function directly, @see $this->optimize_regexp_list().
4681
- *
4682
- * @param &$tokens array of tokens
4683
- * @param $recursed bool to know wether we recursed or not
4684
- * @return string
4685
- * @author Milian Wolff <mail@milianw.de>
4686
- * @since 1.0.8
4687
- * @access private
4688
- */
4689
- function _optimize_regexp_list_tokens_to_string(&$tokens, $recursed = false) {
4690
- $list = '';
4691
- foreach ($tokens as $token => $sub_tokens) {
4692
- $list .= $token;
4693
- $close_entry = isset($sub_tokens['']);
4694
- unset($sub_tokens['']);
4695
- if (!empty($sub_tokens)) {
4696
- $list .= '(?:' . $this->_optimize_regexp_list_tokens_to_string($sub_tokens, true) . ')';
4697
- if ($close_entry) {
4698
- // make sub_tokens optional
4699
- $list .= '?';
4700
- }
4701
- }
4702
- $list .= '|';
4703
- }
4704
- if (!$recursed) {
4705
- // do some optimizations
4706
- // common trailing strings
4707
- // BUGGY!
4708
- //$list = preg_replace_callback('#(?<=^|\:|\|)\w+?(\w+)(?:\|.+\1)+(?=\|)#', create_function(
4709
- // '$matches', 'return "(?:" . preg_replace("#" . preg_quote($matches[1], "#") . "(?=\||$)#", "", $matches[0]) . ")" . $matches[1];'), $list);
4710
- // (?:p)? => p?
4711
- $list = preg_replace('#\(\?\:(.)\)\?#', '\1?', $list);
4712
- // (?:a|b|c|d|...)? => [abcd...]?
4713
- // TODO: a|bb|c => [ac]|bb
4714
- static $callback_2;
4715
- if (!isset($callback_2)) {
4716
- $callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches[1]) . "]";');
4717
- }
4718
- $list = preg_replace_callback('#\(\?\:((?:.\|)+.)\)#', $callback_2, $list);
4719
- }
4720
- // return $list without trailing pipe
4721
- return substr($list, 0, -1);
4722
- }
4723
- } // End Class GeSHi
4724
-
4725
-
4726
- if (!function_exists('geshi_highlight')) {
4727
- /**
4728
- * Easy way to highlight stuff. Behaves just like highlight_string
4729
- *
4730
- * @param string The code to highlight
4731
- * @param string The language to highlight the code in
4732
- * @param string The path to the language files. You can leave this blank if you need
4733
- * as from version 1.0.7 the path should be automatically detected
4734
- * @param boolean Whether to return the result or to echo
4735
- * @return string The code highlighted (if $return is true)
4736
- * @since 1.0.2
4737
- */
4738
- function geshi_highlight($string, $language, $path = null, $return = false) {
4739
- $geshi = new GeSHi($string, $language, $path);
4740
- $geshi->set_header_type(GESHI_HEADER_NONE);
4741
-
4742
- if ($return) {
4743
- return '<code>' . $geshi->parse_code() . '</code>';
4744
- }
4745
-
4746
- echo '<code>' . $geshi->parse_code() . '</code>';
4747
-
4748
- if ($geshi->error()) {
4749
- return false;
4750
- }
4751
- return true;
4752
- }
4753
- }
4754
-
4755
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/apache.php DELETED
@@ -1,483 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * apache.php
4
- * ----------
5
- * Author: Tux (tux@inmail.cz)
6
- * Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2004/29/07
9
- *
10
- * Apache language file for GeSHi.
11
- * Words are from SciTe configuration file
12
- *
13
- * CHANGES
14
- * -------
15
- * 2008/17/06 (1.0.8)
16
- * - Added support for apache configuration sections (milian)
17
- * - Added missing php keywords (milian)
18
- * - Added some more keywords
19
- * - Disabled highlighting of brackets by default
20
- * 2004/11/27 (1.0.2)
21
- * - Added support for multiple object splitters
22
- * 2004/10/27 (1.0.1)
23
- * - Added support for URLs
24
- * 2004/08/05 (1.0.0)
25
- * - First Release
26
- *
27
- * TODO (updated 2004/07/29)
28
- * -------------------------
29
- *
30
- *************************************************************************************
31
- *
32
- * This file is part of GeSHi.
33
- *
34
- * GeSHi is free software; you can redistribute it and/or modify
35
- * it under the terms of the GNU General Public License as published by
36
- * the Free Software Foundation; either version 2 of the License, or
37
- * (at your option) any later version.
38
- *
39
- * GeSHi is distributed in the hope that it will be useful,
40
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
41
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42
- * GNU General Public License for more details.
43
- *
44
- * You should have received a copy of the GNU General Public License
45
- * along with GeSHi; if not, write to the Free Software
46
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
47
- *
48
- ************************************************************************************/
49
-
50
- $language_data = array (
51
- 'LANG_NAME' => 'Apache configuration',
52
- 'COMMENT_SINGLE' => array(1 => '#'),
53
- 'COMMENT_MULTI' => array(),
54
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
55
- 'QUOTEMARKS' => array("'", '"'),
56
- 'ESCAPE_CHAR' => '\\',
57
- 'KEYWORDS' => array(
58
- /*keywords*/
59
- 1 => array(
60
- //core.c
61
- 'AcceptFilter','AcceptPathInfo','AccessConfig','AccessFileName',
62
- 'AddDefaultCharset','AddOutputFilterByType','AllowEncodedSlashes',
63
- 'AllowOverride','AuthName','AuthType','ContentDigest',
64
- 'CoreDumpDirectory','DefaultType','DocumentRoot','EnableMMAP',
65
- 'EnableSendfile','ErrorDocument','ErrorLog','FileETag','ForceType',
66
- 'HostnameLookups','Include','LimitInternalRecursion',
67
- 'LimitRequestBody','LimitRequestFields','LimitRequestFieldsize',
68
- 'LimitRequestLine','LimitXMLRequestBody','LogLevel','MaxMemFree',
69
- 'MaxRequestsPerChild','NameVirtualHost','Options','PidFile','Port',
70
- 'Protocol','Require','RLimitCPU','RLimitMEM','RLimitNPROC',
71
- 'Satisfy','ScoreBoardFile','ServerAdmin','ServerAlias','ServerName',
72
- 'ServerPath','ServerRoot','ServerSignature','ServerTokens',
73
- 'SetHandler','SetInputFilter','SetOutputFilter','ThreadStackSize',
74
- 'Timeout','TraceEnable','UseCanonicalName',
75
- 'UseCanonicalPhysicalPort',
76
-
77
- //http_core.c
78
- 'KeepAlive','KeepAliveTimeout','MaxKeepAliveRequests',
79
-
80
- //mod_actions.c
81
- 'Action','Script',
82
-
83
- //mod_alias.c
84
- 'Alias','AliasMatch','Redirect','RedirectMatch','RedirectPermanent',
85
- 'RedirectTemp','ScriptAlias','ScriptAliasMatch',
86
-
87
- //mod_asis.c
88
-
89
- //mod_auth_basic.c
90
- 'AuthBasicAuthoritative','AuthBasicProvider',
91
-
92
- //mod_auth_digest.c
93
- 'AuthDigestAlgorithm','AuthDigestDomain','AuthDigestNcCheck',
94
- 'AuthDigestNonceFormat','AuthDigestNonceLifetime',
95
- 'AuthDigestProvider','AuthDigestQop','AuthDigestShmemSize',
96
-
97
- //mod_authn_alias.c
98
-
99
- //mod_authn_anon.c
100
- 'Anonymous','Anonymous_LogEmail','Anonymous_MustGiveEmail',
101
- 'Anonymous_NoUserId','Anonymous_VerifyEmail',
102
-
103
- //mod_authn_dbd.c
104
- 'AuthDBDUserPWQuery','AuthDBDUserRealmQuery',
105
-
106
- //mod_authn_dbm.c
107
- 'AuthDBMType','AuthDBMUserFile',
108
-
109
- //mod_authn_default.c
110
- 'AuthDefaultAuthoritative',
111
-
112
- //mod_authn_file.c
113
- 'AuthUserFile',
114
-
115
- //mod_authnz_ldap.c
116
- 'AuthLDAPBindDN','AuthLDAPBindPassword','AuthLDAPCharsetConfig',
117
- 'AuthLDAPCompareDNOnServer','AuthLDAPDereferenceAliases',
118
- 'AuthLDAPGroupAttribute','AuthLDAPGroupAttributeIsDN',
119
- 'AuthLDAPRemoteUserAttribute','AuthLDAPRemoteUserIsDN',
120
- 'AuthLDAPURL','AuthzLDAPAuthoritative',
121
-
122
- //mod_authz_dbm.c
123
- 'AuthDBMGroupFile','AuthzDBMAuthoritative','AuthzDBMType',
124
-
125
- //mod_authz_default.c
126
- 'AuthzDefaultAuthoritative',
127
-
128
- //mod_authz_groupfile.c
129
- 'AuthGroupFile','AuthzGroupFileAuthoritative',
130
-
131
- //mod_authz_host.c
132
- 'Allow','Deny','Order',
133
-
134
- //mod_authz_owner.c
135
- 'AuthzOwnerAuthoritative',
136
-
137
- //mod_authz_svn.c
138
- 'AuthzForceUsernameCase','AuthzSVNAccessFile','AuthzSVNAnonymous',
139
- 'AuthzSVNAuthoritative','AuthzSVNNoAuthWhenAnonymousAllowed',
140
-
141
- //mod_authz_user.c
142
- 'AuthzUserAuthoritative',
143
-
144
- //mod_autoindex.c
145
- 'AddAlt','AddAltByEncoding','AddAltByType','AddDescription',
146
- 'AddIcon','AddIconByEncoding','AddIconByType','DefaultIcon',
147
- 'FancyIndexing','HeaderName','IndexHeadInsert','IndexIgnore',
148
- 'IndexOptions','IndexOrderDefault','IndexStyleSheet','ReadmeName',
149
-
150
- //mod_bt.c
151
- 'Tracker','TrackerDetailURL','TrackerFlags','TrackerHashMaxAge',
152
- 'TrackerHashMinAge','TrackerHashWatermark','TrackerHome',
153
- 'TrackerReturnInterval','TrackerReturnMax',
154
- 'TrackerReturnPeerFactor','TrackerReturnPeers','TrackerRootInclude',
155
- 'TrackerStyleSheet',
156
-
157
- //mod_bw.c
158
- 'BandWidth','BandWidthError','BandWidthModule','BandWidthPacket',
159
- 'ForceBandWidthModule','LargeFileLimit','MaxConnection',
160
- 'MinBandWidth',
161
-
162
- //mod_cache.c
163
- 'CacheDefaultExpire','CacheDisable','CacheEnable',
164
- 'CacheIgnoreCacheControl','CacheIgnoreHeaders',
165
- 'CacheIgnoreNoLastMod','CacheIgnoreQueryString',
166
- 'CacheLastModifiedFactor','CacheMaxExpire','CacheStoreNoStore',
167
- 'CacheStorePrivate',
168
-
169
- //mod_cern_meta.c
170
- 'MetaDir','MetaFiles','MetaSuffix',
171
-
172
- //mod_cgi.c
173
- 'ScriptLog','ScriptLogBuffer','ScriptLogLength',
174
-
175
- //mod_charset_lite.c
176
- 'CharsetDefault','CharsetOptions','CharsetSourceEnc',
177
-
178
- //mod_dav.c
179
- 'DAV','DAVDepthInfinity','DAVMinTimeout',
180
-
181
- //mod_dav_fs.c
182
- 'DAVLockDB',
183
-
184
- //mod_dav_lock.c
185
- 'DAVGenericLockDB',
186
-
187
- //mod_dav_svn.c
188
- 'SVNActivitiesDB','SVNAllowBulkUpdates','SVNAutoversioning',
189
- 'SVNIndexXSLT','SVNListParentPath','SVNMasterURI','SVNParentPath',
190
- 'SVNPath','SVNPathAuthz','SVNReposName','SVNSpecialURI',
191
-
192
- //mod_dbd.c
193
- 'DBDExptime','DBDKeep','DBDMax','DBDMin','DBDParams','DBDPersist',
194
- 'DBDPrepareSQL','DBDriver',
195
-
196
- //mod_deflate.c
197
- 'DeflateBufferSize','DeflateCompressionLevel','DeflateFilterNote',
198
- 'DeflateMemLevel','DeflateWindowSize',
199
-
200
- //mod_dir.c
201
- 'DirectoryIndex','DirectorySlash',
202
-
203
- //mod_disk_cache.c
204
- 'CacheDirLength','CacheDirLevels','CacheMaxFileSize',
205
- 'CacheMinFileSize','CacheRoot',
206
-
207
- //mod_dumpio.c
208
- 'DumpIOInput','DumpIOLogLevel','DumpIOOutput',
209
-
210
- //mod_env.c
211
- 'PassEnv','SetEnv','UnsetEnv',
212
-
213
- //mod_expires.c
214
- 'ExpiresActive','ExpiresByType','ExpiresDefault',
215
-
216
- //mod_ext_filter.c
217
- 'ExtFilterDefine','ExtFilterOptions',
218
-
219
- //mod_file_cache.c
220
- 'cachefile','mmapfile',
221
-
222
- //mod_filter.c
223
- 'FilterChain','FilterDeclare','FilterProtocol','FilterProvider',
224
- 'FilterTrace',
225
-
226
- //mod_gnutls.c
227
- 'GnuTLSCache','GnuTLSCacheTimeout','GnuTLSCertificateFile',
228
- 'GnuTLSKeyFile','GnuTLSPGPCertificateFile','GnuTLSPGPKeyFile',
229
- 'GnuTLSClientVerify','GnuTLSClientCAFile','GnuTLSPGPKeyringFile',
230
- 'GnuTLSEnable','GnuTLSDHFile','GnuTLSRSAFile','GnuTLSSRPPasswdFile',
231
- 'GnuTLSSRPPasswdConfFile','GnuTLSPriorities',
232
- 'GnuTLSExportCertificates',
233
-
234
- //mod_headers.c
235
- 'Header','RequestHeader',
236
-
237
- //mod_imagemap.c
238
- 'ImapBase','ImapDefault','ImapMenu',
239
-
240
- //mod_include.c
241
- 'SSIAccessEnable','SSIEndTag','SSIErrorMsg','SSIStartTag',
242
- 'SSITimeFormat','SSIUndefinedEcho','XBitHack',
243
-
244
- //mod_ident.c
245
- 'IdentityCheck','IdentityCheckTimeout',
246
-
247
- //mod_info.c
248
- 'AddModuleInfo',
249
-
250
- //mod_isapi.c
251
- 'ISAPIAppendLogToErrors','ISAPIAppendLogToQuery','ISAPICacheFile',
252
- 'ISAPIFakeAsync','ISAPILogNotSupported','ISAPIReadAheadBuffer',
253
-
254
- //mod_log_config.c
255
- 'BufferedLogs','CookieLog','CustomLog','LogFormat','TransferLog',
256
-
257
- //mod_log_forensic.c
258
- 'ForensicLog',
259
-
260
- //mod_log_rotate.c
261
- 'RotateInterval','RotateLogs','RotateLogsLocalTime',
262
-
263
- //mod_logio.c
264
-
265
- //mod_mem_cache.c
266
- 'MCacheMaxObjectCount','MCacheMaxObjectSize',
267
- 'MCacheMaxStreamingBuffer','MCacheMinObjectSize',
268
- 'MCacheRemovalAlgorithm','MCacheSize',
269
-
270
- //mod_mime.c
271
- 'AddCharset','AddEncoding','AddHandler','AddInputFilter',
272
- 'AddLanguage','AddOutputFilter','AddType','DefaultLanguage',
273
- 'ModMimeUsePathInfo','MultiviewsMatch','RemoveCharset',
274
- 'RemoveEncoding','RemoveHandler','RemoveInputFilter',
275
- 'RemoveLanguage','RemoveOutputFilter','RemoveType','TypesConfig',
276
-
277
- //mod_mime_magic.c
278
- 'MimeMagicFile',
279
-
280
- //mod_negotiation.c
281
- 'CacheNegotiatedDocs','ForceLanguagePriority','LanguagePriority',
282
-
283
- //mod_php5.c
284
- 'php_admin_flag','php_admin_value','php_flag','php_value',
285
- 'PHPINIDir',
286
-
287
- //mod_proxy.c
288
- 'AllowCONNECT','BalancerMember','NoProxy','ProxyBadHeader',
289
- 'ProxyBlock','ProxyDomain','ProxyErrorOverride',
290
- 'ProxyFtpDirCharset','ProxyIOBufferSize','ProxyMaxForwards',
291
- 'ProxyPass','ProxyPassInterpolateEnv','ProxyPassMatch',
292
- 'ProxyPassReverse','ProxyPassReverseCookieDomain',
293
- 'ProxyPassReverseCookiePath','ProxyPreserveHost',
294
- 'ProxyReceiveBufferSize','ProxyRemote','ProxyRemoteMatch',
295
- 'ProxyRequests','ProxySet','ProxyStatus','ProxyTimeout','ProxyVia',
296
-
297
- //mod_proxy_ajp.c
298
-
299
- //mod_proxy_balancer.c
300
-
301
- //mod_proxy_connect.c
302
-
303
- //mod_proxy_ftp.c
304
-
305
- //mod_proxy_http.c
306
-
307
- //mod_rewrite.c
308
- 'RewriteBase','RewriteCond','RewriteEngine','RewriteLock',
309
- 'RewriteLog','RewriteLogLevel','RewriteMap','RewriteOptions',
310
- 'RewriteRule',
311
-
312
- //mod_setenvif.c
313
- 'BrowserMatch','BrowserMatchNoCase','SetEnvIf','SetEnvIfNoCase',
314
-
315
- //mod_so.c
316
- 'LoadFile','LoadModule',
317
-
318
- //mod_speling.c
319
- 'CheckCaseOnly','CheckSpelling',
320
-
321
- //mod_ssl.c
322
- 'SSLCACertificateFile','SSLCACertificatePath','SSLCADNRequestFile',
323
- 'SSLCADNRequestPath','SSLCARevocationFile','SSLCARevocationPath',
324
- 'SSLCertificateChainFile','SSLCertificateFile',
325
- 'SSLCertificateKeyFile','SSLCipherSuite','SSLCryptoDevice',
326
- 'SSLEngine','SSLHonorCipherOrder','SSLMutex','SSLOptions',
327
- 'SSLPassPhraseDialog','SSLProtocol','SSLProxyCACertificateFile',
328
- 'SSLProxyCACertificatePath','SSLProxyCARevocationFile',
329
- 'SSLProxyCARevocationPath','SSLProxyCipherSuite','SSLProxyEngine',
330
- 'SSLProxyMachineCertificateFile','SSLProxyMachineCertificatePath',
331
- 'SSLProxyProtocol','SSLProxyVerify','SSLProxyVerifyDepth',
332
- 'SSLRandomSeed','SSLRenegBufferSize','SSLRequire','SSLRequireSSL',
333
- 'SSLSessionCache','SSLSessionCacheTimeout','SSLUserName',
334
- 'SSLVerifyClient','SSLVerifyDepth',
335
-
336
- //mod_status.c
337
- 'ExtendedStatus','SeeRequestTail',
338
-
339
- //mod_substitute.c
340
- 'Substitute',
341
-
342
- //mod_suexec.c
343
- 'SuexecUserGroup',
344
-
345
- //mod_unique_id.c
346
-
347
- //mod_upload_progress
348
- 'ReportUploads', 'TrackUploads', 'UploadProgressSharedMemorySize',
349
-
350
- //mod_userdir.c
351
- 'UserDir',
352
-
353
- //mod_usertrack.c
354
- 'CookieDomain','CookieExpires','CookieName','CookieStyle',
355
- 'CookieTracking',
356
-
357
- //mod_version.c
358
-
359
- //mod_vhost_alias.c
360
- 'VirtualDocumentRoot','VirtualDocumentRootIP',
361
- 'VirtualScriptAlias','VirtualScriptAliasIP',
362
-
363
- //mod_view.c
364
- 'ViewEnable',
365
-
366
- //mod_win32.c
367
- 'ScriptInterpreterSource',
368
-
369
- //mpm_winnt.c
370
- 'Listen','ListenBacklog','ReceiveBufferSize','SendBufferSize',
371
- 'ThreadLimit','ThreadsPerChild','Win32DisableAcceptEx',
372
-
373
- //mpm_common.c
374
- 'AcceptMutex','AddModule','ClearModuleList','EnableExceptionHook',
375
- 'Group','LockFile','MaxClients','MaxSpareServers','MaxSpareThreads',
376
- 'MinSpareServers','MinSpareThreads','ServerLimit','StartServers',
377
- 'StartThreads','User',
378
-
379
- //util_ldap.c
380
- 'LDAPCacheEntries','LDAPCacheTTL','LDAPConnectionTimeout',
381
- 'LDAPOpCacheEntries','LDAPOpCacheTTL','LDAPSharedCacheFile',
382
- 'LDAPSharedCacheSize','LDAPTrustedClientCert',
383
- 'LDAPTrustedGlobalCert','LDAPTrustedMode','LDAPVerifyServerCert',
384
-
385
- //Unknown Mods ...
386
- 'AgentLog','BindAddress','bs2000account','CacheForceCompletion',
387
- 'CacheGCInterval','CacheSize','NoCache','qsc','RefererIgnore',
388
- 'RefererLog','Resourceconfig','ServerType','SingleListen'
389
- ),
390
- /*keywords 2*/
391
- 2 => array(
392
- 'all','on','off','standalone','inetd','indexes',
393
- 'force-response-1.0','downgrade-1.0','nokeepalive',
394
- 'includes','followsymlinks','none',
395
- 'x-compress','x-gzip'
396
- ),
397
- /*keywords 3*/
398
- 3 => array(
399
- //core.c
400
- 'Directory','DirectoryMatch','Files','FilesMatch','IfDefine',
401
- 'IfModule','Limit','LimitExcept','Location','LocationMatch',
402
- 'VirtualHost',
403
-
404
- //mod_authn_alias.c
405
- 'AuthnProviderAlias',
406
-
407
- //mod_proxy.c
408
- 'Proxy','ProxyMatch',
409
-
410
- //mod_version.c
411
- 'IfVersion'
412
- )
413
- ),
414
- 'SYMBOLS' => array(
415
- '+', '-'
416
- ),
417
- 'CASE_SENSITIVE' => array(
418
- GESHI_COMMENTS => false,
419
- 1 => false,
420
- 2 => false,
421
- 3 => false,
422
- ),
423
- 'STYLES' => array(
424
- 'KEYWORDS' => array(
425
- 1 => 'color: #00007f;',
426
- 2 => 'color: #0000ff;',
427
- 3 => 'color: #000000; font-weight:bold;',
428
- ),
429
- 'COMMENTS' => array(
430
- 1 => 'color: #adadad; font-style: italic;',
431
- ),
432
- 'ESCAPE_CHAR' => array(
433
- 0 => 'color: #000099; font-weight: bold;'
434
- ),
435
- 'BRACKETS' => array(
436
- 0 => 'color: #339933;'
437
- ),
438
- 'STRINGS' => array(
439
- 0 => 'color: #7f007f;'
440
- ),
441
- 'NUMBERS' => array(
442
- 0 => 'color: #ff0000;'
443
- ),
444
- 'METHODS' => array(
445
- ),
446
- 'SYMBOLS' => array(
447
- 0 => 'color: #008000;'
448
- ),
449
- 'REGEXPS' => array(
450
- ),
451
- 'SCRIPT' => array(
452
- )
453
- ),
454
- 'URLS' => array(
455
- 1 => '',
456
- 2 => '',
457
- 3 => ''
458
- ),
459
- 'OOLANG' => false,
460
- 'OBJECT_SPLITTERS' => array(
461
- ),
462
- 'REGEXPS' => array(
463
- ),
464
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
465
- 'SCRIPT_DELIMITERS' => array(
466
- ),
467
- 'HIGHLIGHT_STRICT_BLOCK' => array(
468
- ),
469
- 'PARSER_CONTROL' => array(
470
- 'ENABLE_FLAGS' => array(
471
- 'BRACKETS' => GESHI_NEVER,
472
- 'SYMBOLS' => GESHI_NEVER
473
- ),
474
- 'KEYWORDS' => array(
475
- 3 => array(
476
- 'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
477
- 'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
478
- )
479
- )
480
- )
481
- );
482
-
483
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/bash.php DELETED
@@ -1,440 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * bash.php
4
- * --------
5
- * Author: Andreas Gohr (andi@splitbrain.org)
6
- * Copyright: (c) 2004 Andreas Gohr, Nigel McNie (http://qbnz.com/highlighter)
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2004/08/20
9
- *
10
- * BASH language file for GeSHi.
11
- *
12
- * CHANGES
13
- * -------
14
- * 2008/06/21 (1.0.8)
15
- * - Added loads of keywords and commands of GNU/Linux
16
- * - Added support for parameters starting with a dash
17
- * 2008/05/23 (1.0.7.22)
18
- * - Added description of extra language features (SF#1970248)
19
- * 2007/09/05 (1.0.7.21)
20
- * - PARSER_CONTROL patch using SF #1788408 (BenBE)
21
- * 2007/06/11 (1.0.7.20)
22
- * - Added a lot of keywords (BenBE / Jan G)
23
- * 2004/11/27 (1.0.2)
24
- * - Added support for multiple object splitters
25
- * 2004/10/27 (1.0.1)
26
- * - Added support for URLs
27
- * 2004/08/20 (1.0.0)
28
- * - First Release
29
- *
30
- * TODO (updated 2004/11/27)
31
- * -------------------------
32
- * * Get symbols working
33
- * * Highlight builtin vars
34
- *
35
- *************************************************************************************
36
- *
37
- * This file is part of GeSHi.
38
- *
39
- * GeSHi is free software; you can redistribute it and/or modify
40
- * it under the terms of the GNU General Public License as published by
41
- * the Free Software Foundation; either version 2 of the License, or
42
- * (at your option) any later version.
43
- *
44
- * GeSHi is distributed in the hope that it will be useful,
45
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
46
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47
- * GNU General Public License for more details.
48
- *
49
- * You should have received a copy of the GNU General Public License
50
- * along with GeSHi; if not, write to the Free Software
51
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
52
- *
53
- ************************************************************************************/
54
-
55
- $language_data = array (
56
- 'LANG_NAME' => 'Bash',
57
- // Bash DOES have single line comments with # markers. But bash also has
58
- // the $# variable, so comments need special handling (see sf.net
59
- // 1564839)
60
- 'COMMENT_SINGLE' => array('#'),
61
- 'COMMENT_MULTI' => array(),
62
- 'COMMENT_REGEXP' => array(
63
- //Variables
64
- 1 => "/\\$\\{[^\\n\\}]*?\\}/i",
65
- //BASH-style Heredoc
66
- 2 => '/<<-?\s*?(\'?)([a-zA-Z0-9]+)\1\\n.*\\n\\2(?![a-zA-Z0-9])/siU',
67
- //Escaped String Starters
68
- 3 => "/\\\\['\"]/siU",
69
- // Single-Line Shell usage: Hide the prompt at the beginning
70
- /* 4 => "/\A(?!#!)\s*(?>[\w:@\\/\\-\\._~]*[$#]\s?)?(?=[^\n]+\n?\Z)|^(?!#!)(\w+@)?[\w\\-\\.]+(:~?)[\w\\/\\-\\._]*?[$#]\s?/ms" */
71
- 4 => "/\A(?!#!)(?:(?>[\w:@\\/\\-\\._~]*)[$#]\s?)(?=(?>[^\n]+)\n?\Z)|^(?!#!)(?:\w+@)?(?>[\w\\-\\.]+)(?>:~?[\w\\/\\-\\._]*?)?[$#]\s?/sm"
72
- ),
73
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
74
- 'QUOTEMARKS' => array('"'),
75
- 'HARDQUOTE' => array("'", "'"),
76
- 'HARDESCAPE' => array("\'"),
77
- 'ESCAPE_CHAR' => '',
78
- 'ESCAPE_REGEXP' => array(
79
- //Simple Single Char Escapes
80
- 1 => "#\\\\[nfrtv\\$\\\"\n]#i",
81
- // $var
82
- 2 => "#\\$[a-z_][a-z0-9_]*#i",
83
- // ${...}
84
- 3 => "/\\$\\{[^\\n\\}]*?\\}/i",
85
- // $(...)
86
- 4 => "/\\$\\([^\\n\\)]*?\\)/i",
87
- // `...`
88
- 5 => "/`[^`]*`/"
89
- ),
90
- 'KEYWORDS' => array(
91
- 1 => array(
92
- 'case', 'do', 'done', 'elif', 'else', 'esac', 'fi', 'for', 'function',
93
- 'if', 'in', 'select', 'set', 'then', 'until', 'while', 'time'
94
- ),
95
- 2 => array(
96
- 'aclocal', 'aconnect', 'apachectl', 'apache2ctl', 'aplay', 'apm',
97
- 'apmsleep', 'apropos', 'apt-cache', 'apt-cdrom', 'apt-config',
98
- 'apt-file', 'apt-ftparchive', 'apt-get', 'apt-key', 'apt-listbugs',
99
- 'apt-listchanges', 'apt-mark', 'apt-mirror', 'apt-sortpkgs',
100
- 'apt-src', 'apticron', 'aptitude', 'aptsh', 'apxs', 'apxs2', 'ar',
101
- 'arch', 'arecord', 'as', 'as86', 'ash', 'autoconf', 'autoheader',
102
- 'automake', 'awk',
103
-
104
- 'apachectl start', 'apachectl stop', 'apachectl restart',
105
- 'apachectl graceful', 'apachectl graceful-stop',
106
- 'apachectl configtest', 'apachectl status', 'apachectl fullstatus',
107
- 'apachectl help', 'apache2ctl start', 'apache2ctl stop',
108
- 'apache2ctl restart', 'apache2ctl graceful',
109
- 'apache2ctl graceful-stop', 'apache2ctl configtest',
110
- 'apache2ctl status', 'apache2ctl fullstatus', 'apache2ctl help',
111
-
112
- 'apt-cache add', 'apt-cache depends', 'apt-cache dotty',
113
- 'apt-cache dump', 'apt-cache dumpavail', 'apt-cache gencaches',
114
- 'apt-cache pkgnames', 'apt-cache policy', 'apt-cache rdepends',
115
- 'apt-cache search', 'apt-cache show', 'apt-cache showauto',
116
- 'apt-cache showpkg', 'apt-cache showsrc', 'apt-cache stats',
117
- 'apt-cache unmet', 'apt-cache xvcg', 'apt-cdrom add',
118
- 'apt-cdrom ident', 'apt-config dump', 'apt-config shell',
119
- 'apt-file find', 'apt-file list', 'apt-file purge',
120
- 'apt-file search', 'apt-file shot', 'apt-file update',
121
- 'apt-get autoclean', 'apt-get autoremove', 'apt-get build-dep',
122
- 'apt-get check', 'apt-get clean', 'apt-get dist-upgrade',
123
- 'apt-get dselect-upgrade', 'apt-get install', 'apt-get markauto',
124
- 'apt-get purge', 'apt-get remove', 'apt-get source',
125
- 'apt-get unmarkauto', 'apt-get update', 'apt-get upgrade',
126
- 'apt-key add', 'apt-key adv', 'apt-key del', 'apt-key export',
127
- 'apt-key exportall', 'apt-key finger', 'apt-key list',
128
- 'apt-key net-update', 'apt-key update', 'apt-listbugs apt',
129
- 'apt-listbugs list', 'apt-listbugs rss', 'apt-src build',
130
- 'apt-src clean', 'apt-src import', 'apt-src install',
131
- 'apt-src list', 'apt-src location', 'apt-src name',
132
- 'apt-src remove', 'apt-src update', 'apt-src upgrade',
133
- 'apt-src version',
134
-
135
- 'basename', 'bash', 'bc', 'bison', 'bunzip2', 'bzcat',
136
- 'bzcmp', 'bzdiff', 'bzegrep', 'bzfgrep', 'bzgrep',
137
- 'bzip2', 'bzip2recover', 'bzless', 'bzmore',
138
-
139
- 'c++', 'cal', 'cat', 'chattr', 'cc', 'cdda2wav', 'cdparanoia',
140
- 'cdrdao', 'cd-read', 'cdrecord', 'chfn', 'chgrp', 'chmod',
141
- 'chown', 'chroot', 'chsh', 'chvt', 'clear', 'cmp', 'comm', 'co',
142
- 'col', 'cp', 'cpio', 'cpp', 'csh', 'cut', 'cvs', 'cvs-pserver',
143
-
144
- 'cvs add', 'cvs admin', 'cvs annotate', 'cvs checkout',
145
- 'cvs commit', 'cvs diff', 'cvs edit', 'cvs editors', 'cvs export',
146
- 'cvs history', 'cvs import', 'cvs init', 'cvs log', 'cvs login',
147
- 'cvs logout', 'cvs ls', 'cvs pserver', 'cvs rannotate',
148
- 'cvs rdiff', 'cvs release', 'cvs remove', 'cvs rlog', 'cvs rls',
149
- 'cvs rtag', 'cvs server', 'cvs status', 'cvs tag', 'cvs unedit',
150
- 'cvs update', 'cvs version', 'cvs watch', 'cvs watchers',
151
-
152
- 'dash', 'date', 'dc', 'dch', 'dcop', 'dd', 'ddate', 'ddd',
153
- 'deallocvt', 'debconf', 'defoma', 'depmod', 'df', 'dh',
154
- 'dialog', 'diff', 'diff3', 'dig', 'dir', 'dircolors', 'directomatic',
155
- 'dirname', 'dmesg', 'dnsdomainname', 'domainname', 'dpkg',
156
- 'dselect', 'du', 'dumpkeys',
157
-
158
- 'ed', 'egrep', 'env', 'expr',
159
-
160
- 'false', 'fbset', 'ffmpeg', 'fgconsole','fgrep', 'file', 'find',
161
- 'flex', 'flex++', 'fmt', 'free', 'ftp', 'funzip', 'fuser',
162
-
163
- 'g++', 'gawk', 'gc','gcc', 'gdb', 'getent', 'getkeycodes',
164
- 'getopt', 'gettext', 'gettextize', 'gimp', 'gimp-remote',
165
- 'gimptool', 'gmake', 'gocr', 'grep', 'groups', 'gs', 'gunzip',
166
- 'gzexe', 'gzip',
167
-
168
- 'git', 'git add', 'git add--interactive', 'git am', 'git annotate',
169
- 'git apply', 'git archive', 'git bisect', 'git bisect--helper',
170
- 'git blame', 'git branch', 'git bundle', 'git cat-file',
171
- 'git check-attr', 'git checkout', 'git checkout-index',
172
- 'git check-ref-format', 'git cherry', 'git cherry-pick',
173
- 'git clean', 'git clone', 'git commit', 'git commit-tree',
174
- 'git config', 'git count-objects', 'git daemon', 'git describe',
175
- 'git diff', 'git diff-files', 'git diff-index', 'git difftool',
176
- 'git difftool--helper', 'git diff-tree', 'git fast-export',
177
- 'git fast-import', 'git fetch', 'git fetch-pack',
178
- 'git filter-branch', 'git fmt-merge-msg', 'git for-each-ref',
179
- 'git format-patch', 'git fsck', 'git fsck-objects', 'git gc',
180
- 'git get-tar-commit-id', 'git grep', 'git hash-object', 'git help',
181
- 'git http-backend', 'git http-fetch', 'git http-push',
182
- 'git imap-send', 'git index-pack', 'git init', 'git init-db',
183
- 'git instaweb', 'git log', 'git lost-found', 'git ls-files',
184
- 'git ls-remote', 'git ls-tree', 'git mailinfo', 'git mailsplit',
185
- 'git merge', 'git merge-base', 'git merge-file', 'git merge-index',
186
- 'git merge-octopus', 'git merge-one-file', 'git merge-ours',
187
- 'git merge-recursive', 'git merge-resolve', 'git merge-subtree',
188
- 'git mergetool', 'git merge-tree', 'git mktag', 'git mktree',
189
- 'git mv', 'git name-rev', 'git notes', 'git pack-objects',
190
- 'git pack-redundant', 'git pack-refs', 'git patch-id',
191
- 'git peek-remote', 'git prune', 'git prune-packed', 'git pull',
192
- 'git push', 'git quiltimport', 'git read-tree', 'git rebase',
193
- 'git rebase--interactive', 'git receive-pack', 'git reflog',
194
- 'git relink', 'git remote', 'git remote-ftp', 'git remote-ftps',
195
- 'git remote-http', 'git remote-https', 'git remote-testgit',
196
- 'git repack', 'git replace', 'git repo-config', 'git request-pull',
197
- 'git rerere', 'git reset', 'git revert', 'git rev-list',
198
- 'git rev-parse', 'git rm', 'git send-pack', 'git shell',
199
- 'git shortlog', 'git show', 'git show-branch', 'git show-index',
200
- 'git show-ref', 'git stage', 'git stash', 'git status',
201
- 'git stripspace', 'git submodule', 'git symbolic-ref', 'git tag',
202
- 'git tar-tree', 'git unpack-file', 'git unpack-objects',
203
- 'git update-index', 'git update-ref', 'git update-server-info',
204
- 'git upload-archive', 'git upload-pack', 'git var',
205
- 'git verify-pack', 'git verify-tag', 'git web--browse',
206
- 'git whatchanged', 'git write-tree',
207
-
208
- 'gitaction', 'git-add', 'git-add--interactive', 'git-am',
209
- 'git-annotate', 'git-apply', 'git-archive', 'git-bisect',
210
- 'git-bisect--helper', 'git-blame', 'git-branch', 'git-bundle',
211
- 'git-cat-file', 'git-check-attr', 'git-checkout',
212
- 'git-checkout-index', 'git-check-ref-format', 'git-cherry',
213
- 'git-cherry-pick', 'git-clean', 'git-clone', 'git-commit',
214
- 'git-commit-tree', 'git-config', 'git-count-objects', 'git-daemon',
215
- 'git-describe', 'git-diff', 'git-diff-files', 'git-diff-index',
216
- 'git-difftool', 'git-difftool--helper', 'git-diff-tree',
217
- 'gitdpkgname', 'git-fast-export', 'git-fast-import', 'git-fetch',
218
- 'git-fetch-pack', 'git-fetch--tool', 'git-filter-branch', 'gitfm',
219
- 'git-fmt-merge-msg', 'git-for-each-ref', 'git-format-patch',
220
- 'git-fsck', 'git-fsck-objects', 'git-gc', 'git-get-tar-commit-id',
221
- 'git-grep', 'git-hash-object', 'git-help', 'git-http-fetch',
222
- 'git-http-push', 'git-imap-send', 'git-index-pack', 'git-init',
223
- 'git-init-db', 'git-instaweb', 'gitkeys', 'git-log',
224
- 'git-lost-found', 'git-ls-files', 'git-ls-remote', 'git-ls-tree',
225
- 'git-mailinfo', 'git-mailsplit', 'git-merge', 'git-merge-base',
226
- 'git-merge-file', 'git-merge-index', 'git-merge-octopus',
227
- 'git-merge-one-file', 'git-merge-ours', 'git-merge-recursive',
228
- 'git-merge-resolve', 'git-merge-subtree', 'git-mergetool',
229
- 'git-mergetool--lib', 'git-merge-tree', 'gitmkdirs', 'git-mktag',
230
- 'git-mktree', 'gitmount', 'git-mv', 'git-name-rev',
231
- 'git-pack-objects', 'git-pack-redundant', 'git-pack-refs',
232
- 'git-parse-remote', 'git-patch-id', 'git-peek-remote', 'git-prune',
233
- 'git-prune-packed', 'gitps', 'git-pull', 'git-push',
234
- 'git-quiltimport', 'git-read-tree', 'git-rebase',
235
- 'git-rebase--interactive', 'git-receive-pack', 'git-reflog',
236
- 'gitregrep', 'git-relink', 'git-remote', 'git-repack',
237
- 'git-repo-config', 'git-request-pull', 'git-rerere', 'git-reset',
238
- 'git-revert', 'git-rev-list', 'git-rev-parse', 'gitrfgrep',
239
- 'gitrgrep', 'git-rm', 'git-send-pack', 'git-shell', 'git-shortlog',
240
- 'git-show', 'git-show-branch', 'git-show-index', 'git-show-ref',
241
- 'git-sh-setup', 'git-stage', 'git-stash', 'git-status',
242
- 'git-stripspace', 'git-submodule', 'git-svn', 'git-symbolic-ref',
243
- 'git-tag', 'git-tar-tree', 'gitunpack', 'git-unpack-file',
244
- 'git-unpack-objects', 'git-update-index', 'git-update-ref',
245
- 'git-update-server-info', 'git-upload-archive', 'git-upload-pack',
246
- 'git-var', 'git-verify-pack', 'git-verify-tag', 'gitview',
247
- 'git-web--browse', 'git-whatchanged', 'gitwhich', 'gitwipe',
248
- 'git-write-tree', 'gitxgrep',
249
-
250
- 'head', 'hexdump', 'hostname',
251
-
252
- 'id', 'ifconfig', 'ifdown', 'ifup', 'igawk', 'install',
253
-
254
- 'ip', 'ip addr', 'ip addrlabel', 'ip link', 'ip maddr', 'ip mroute',
255
- 'ip neigh', 'ip route', 'ip rule', 'ip tunnel', 'ip xfrm',
256
-
257
- 'join',
258
-
259
- 'kbd_mode','kbdrate', 'kdialog', 'kfile', 'kill', 'killall',
260
-
261
- 'lame', 'last', 'lastb', 'ld', 'ld86', 'ldd', 'less', 'lex', 'link',
262
- 'ln', 'loadkeys', 'loadunimap', 'locate', 'lockfile', 'login',
263
- 'logname', 'lp', 'lpr', 'ls', 'lsattr', 'lsmod', 'lsmod.old',
264
- 'lspci', 'ltrace', 'lynx',
265
-
266
- 'm4', 'make', 'man', 'mapscrn', 'mesg', 'mkdir', 'mkfifo',
267
- 'mknod', 'mktemp', 'more', 'mount', 'mplayer', 'msgfmt', 'mv',
268
-
269
- 'namei', 'nano', 'nasm', 'nawk', 'netstat', 'nice',
270
- 'nisdomainname', 'nl', 'nm', 'nm86', 'nmap', 'nohup', 'nop',
271
-
272
- 'od', 'openvt',
273
-
274
- 'passwd', 'patch', 'pcregrep', 'pcretest', 'perl', 'perror',
275
- 'pgawk', 'pidof', 'ping', 'pr', 'procmail', 'prune', 'ps', 'pstree',
276
- 'ps2ascii', 'ps2epsi', 'ps2frag', 'ps2pdf', 'ps2ps', 'psbook',
277
- 'psmerge', 'psnup', 'psresize', 'psselect', 'pstops',
278
-
279
- 'rbash', 'rcs', 'rcs2log', 'read', 'readlink', 'red', 'resizecons',
280
- 'rev', 'rm', 'rmdir', 'rsh', 'run-parts',
281
-
282
- 'sash', 'scp', 'screen', 'sed', 'seq', 'sendmail', 'setfont',
283
- 'setkeycodes', 'setleds', 'setmetamode', 'setserial', 'setterm',
284
- 'sh', 'showkey', 'shred', 'size', 'size86', 'skill', 'sleep',
285
- 'slogin', 'snice', 'sort', 'sox', 'split', 'ssed', 'ssh', 'ssh-add',
286
- 'ssh-agent', 'ssh-keygen', 'ssh-keyscan', 'stat', 'strace',
287
- 'strings', 'strip', 'stty', 'su', 'sudo', 'suidperl', 'sum', 'svn',
288
- 'svnadmin', 'svndumpfilter', 'svnlook', 'svnmerge', 'svnmucc',
289
- 'svnserve', 'svnshell', 'svnsync', 'svnversion', 'svnwrap', 'sync',
290
-
291
- 'svn add', 'svn ann', 'svn annotate', 'svn blame', 'svn cat',
292
- 'svn changelist', 'svn checkout', 'svn ci', 'svn cl', 'svn cleanup',
293
- 'svn co', 'svn commit', 'svn copy', 'svn cp', 'svn del',
294
- 'svn delete', 'svn di', 'svn diff', 'svn export', 'svn h',
295
- 'svn help', 'svn import', 'svn info', 'svn list', 'svn lock',
296
- 'svn log', 'svn ls', 'svn merge', 'svn mergeinfo', 'svn mkdir',
297
- 'svn move', 'svn mv', 'svn pd', 'svn pdel', 'svn pe', 'svn pedit',
298
- 'svn pg', 'svn pget', 'svn pl', 'svn plist', 'svn praise',
299
- 'svn propdel', 'svn propedit', 'svn propget', 'svn proplist',
300
- 'svn propset', 'svn ps', 'svn pset', 'svn remove', 'svn ren',
301
- 'svn rename', 'svn resolve', 'svn resolved', 'svn revert', 'svn rm',
302
- 'svn st', 'svn stat', 'svn status', 'svn sw', 'svn switch',
303
- 'svn unlock', 'svn up', 'svn update',
304
-
305
- 'tac', 'tail', 'tar', 'tee', 'tempfile', 'touch', 'tr', 'tree',
306
- 'true',
307
-
308
- 'umount', 'uname', 'unicode_start', 'unicode_stop', 'uniq',
309
- 'unlink', 'unzip', 'updatedb', 'updmap', 'uptime', 'users',
310
- 'utmpdump', 'uuidgen',
311
-
312
- 'valgrind', 'vdir', 'vi', 'vim', 'vmstat',
313
-
314
- 'w', 'wall', 'watch', 'wc', 'wget', 'whatis', 'whereis',
315
- 'which', 'whiptail', 'who', 'whoami', 'whois', 'wine', 'wineboot',
316
- 'winebuild', 'winecfg', 'wineconsole', 'winedbg', 'winedump',
317
- 'winefile', 'wodim', 'write',
318
-
319
- 'xargs', 'xhost', 'xmodmap', 'xset',
320
-
321
- 'yacc', 'yes', 'ypdomainname', 'yum',
322
-
323
- 'yum check-update', 'yum clean', 'yum deplist', 'yum erase',
324
- 'yum groupinfo', 'yum groupinstall', 'yum grouplist',
325
- 'yum groupremove', 'yum groupupdate', 'yum info', 'yum install',
326
- 'yum list', 'yum localinstall', 'yum localupdate', 'yum makecache',
327
- 'yum provides', 'yum remove', 'yum resolvedep', 'yum search',
328
- 'yum shell', 'yum update', 'yum upgrade', 'yum whatprovides',
329
-
330
- 'zcat', 'zcmp', 'zdiff', 'zdump', 'zegrep', 'zfgrep', 'zforce',
331
- 'zgrep', 'zip', 'zipgrep', 'zipinfo', 'zless', 'zmore', 'znew',
332
- 'zsh', 'zsoelim'
333
- ),
334
- 3 => array(
335
- 'alias', 'bg', 'bind', 'break', 'builtin', 'cd', 'command',
336
- 'compgen', 'complete', 'continue', 'declare', 'dirs', 'disown',
337
- 'echo', 'enable', 'eval', 'exec', 'exit', 'export', 'fc',
338
- 'fg', 'getopts', 'hash', 'help', 'history', 'jobs', 'let',
339
- 'local', 'logout', 'popd', 'printf', 'pushd', 'pwd', 'readonly',
340
- 'return', 'shift', 'shopt', 'source', 'suspend', 'test', 'times',
341
- 'trap', 'type', 'typeset', 'ulimit', 'umask', 'unalias', 'unset',
342
- 'wait'
343
- )
344
- ),
345
- 'SYMBOLS' => array(
346
- '(', ')', '[', ']', '!', '@', '%', '&', '*', '|', '/', '<', '>', ';;', '`'
347
- ),
348
- 'CASE_SENSITIVE' => array(
349
- GESHI_COMMENTS => false,
350
- 1 => true,
351
- 2 => true,
352
- 3 => true
353
- ),
354
- 'STYLES' => array(
355
- 'KEYWORDS' => array(
356
- 1 => 'color: #000000; font-weight: bold;',
357
- 2 => 'color: #c20cb9; font-weight: bold;',
358
- 3 => 'color: #7a0874; font-weight: bold;'
359
- ),
360
- 'COMMENTS' => array(
361
- 0 => 'color: #666666; font-style: italic;',
362
- 1 => 'color: #800000;',
363
- 2 => 'color: #cc0000; font-style: italic;',
364
- 3 => 'color: #000000; font-weight: bold;',
365
- 4 => 'color: #666666;'
366
- ),
367
- 'ESCAPE_CHAR' => array(
368
- 1 => 'color: #000099; font-weight: bold;',
369
- 2 => 'color: #007800;',
370
- 3 => 'color: #007800;',
371
- 4 => 'color: #007800;',
372
- 5 => 'color: #780078;',
373
- 'HARD' => 'color: #000099; font-weight: bold;'
374
- ),
375
- 'BRACKETS' => array(
376
- 0 => 'color: #7a0874; font-weight: bold;'
377
- ),
378
- 'STRINGS' => array(
379
- 0 => 'color: #ff0000;',
380
- 'HARD' => 'color: #ff0000;'
381
- ),
382
- 'NUMBERS' => array(
383
- 0 => 'color: #000000;'
384
- ),
385
- 'METHODS' => array(
386
- ),
387
- 'SYMBOLS' => array(
388
- 0 => 'color: #000000; font-weight: bold;'
389
- ),
390
- 'REGEXPS' => array(
391
- 0 => 'color: #007800;',
392
- 1 => 'color: #007800;',
393
- 2 => 'color: #007800;',
394
- 4 => 'color: #007800;',
395
- 5 => 'color: #660033;'
396
- ),
397
- 'SCRIPT' => array(
398
- )
399
- ),
400
- 'URLS' => array(
401
- 1 => '',
402
- 2 => '',
403
- 3 => ''
404
- ),
405
- 'OOLANG' => false,
406
- 'OBJECT_SPLITTERS' => array(
407
- ),
408
- 'REGEXPS' => array(
409
- //Variables (will be handled by comment_regexps)
410
- 0 => "\\$\\{[a-zA-Z_][a-zA-Z0-9_]*?\\}",
411
- //Variables without braces
412
- 1 => "\\$[a-zA-Z_][a-zA-Z0-9_]*",
413
- //Variable assignment
414
- 2 => "(?<![\.a-zA-Z_\-])([a-zA-Z_][a-zA-Z0-9_]*?)(?==)",
415
- //Shorthand shell variables
416
- 4 => "\\$[*#\$\\-\\?!\d]",
417
- //Parameters of commands
418
- 5 => "(?<=\s)--?[0-9a-zA-Z\-]+(?=[\s=]|<(?:SEMI|PIPE)>|$)"
419
- ),
420
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
421
- 'SCRIPT_DELIMITERS' => array(
422
- ),
423
- 'HIGHLIGHT_STRICT_BLOCK' => array(
424
- ),
425
- 'TAB_WIDTH' => 4,
426
- 'PARSER_CONTROL' => array(
427
- 'COMMENTS' => array(
428
- 'DISALLOWED_BEFORE' => '$'
429
- ),
430
- 'KEYWORDS' => array(
431
- 'DISALLOWED_BEFORE' => "(?<![\.\-a-zA-Z0-9_\$\#:])",
432
- 'DISALLOWED_AFTER' => "(?![\.\-a-zA-Z0-9_%=\\/:])",
433
- 2 => array(
434
- 'SPACE_AS_WHITESPACE' => false
435
- )
436
- )
437
- )
438
- );
439
-
440
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/css.php DELETED
@@ -1,223 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * css.php
4
- * -------
5
- * Author: Nigel McNie (nigel@geshi.org)
6
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2004/06/18
9
- *
10
- * CSS language file for GeSHi.
11
- *
12
- * CHANGES
13
- * -------
14
- * 2008/05/23 (1.0.7.22)
15
- * - Added description of extra language features (SF#1970248)
16
- * 2004/11/27 (1.0.3)
17
- * - Added support for multiple object splitters
18
- * 2004/10/27 (1.0.2)
19
- * - Changed regexps to catch "-" symbols
20
- * - Added support for URLs
21
- * 2004/08/05 (1.0.1)
22
- * - Added support for symbols
23
- * 2004/07/14 (1.0.0)
24
- * - First Release
25
- *
26
- * TODO (updated 2004/11/27)
27
- * -------------------------
28
- * * Improve or drop regexps for class/id/psuedoclass highlighting
29
- * * Re-look at keywords - possibly to make several CSS language
30
- * files, all with different versions of CSS in them
31
- *
32
- *************************************************************************************
33
- *
34
- * This file is part of GeSHi.
35
- *
36
- * GeSHi is free software; you can redistribute it and/or modify
37
- * it under the terms of the GNU General Public License as published by
38
- * the Free Software Foundation; either version 2 of the License, or
39
- * (at your option) any later version.
40
- *
41
- * GeSHi is distributed in the hope that it will be useful,
42
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
43
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44
- * GNU General Public License for more details.
45
- *
46
- * You should have received a copy of the GNU General Public License
47
- * along with GeSHi; if not, write to the Free Software
48
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
49
- *
50
- ************************************************************************************/
51
-
52
- $language_data = array (
53
- 'LANG_NAME' => 'CSS',
54
- 'COMMENT_SINGLE' => array(1 => '@'),
55
- 'COMMENT_MULTI' => array('/*' => '*/'),
56
- 'COMMENT_REGEXP' => array(
57
- 2 => "/(?<=\\()\\s*(?:(?:[a-z0-9]+?:\\/\\/)?[a-z0-9_\\-\\.\\/:]+?)?[a-z]+?\\.[a-z]+?(\\?[^\)]+?)?\\s*?(?=\\))/i"
58
- ),
59
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
60
- 'QUOTEMARKS' => array('"', "'"),
61
- 'ESCAPE_CHAR' => '',
62
- 'ESCAPE_REGEXP' => array(
63
- //Simple Single Char Escapes
64
- //1 => "#\\\\[nfrtv\$\"\n\\\\]#i",
65
- //Hexadecimal Char Specs
66
- 2 => "#\\\\[\da-fA-F]{1,6}\s?#i",
67
- //Unicode Char Specs
68
- //3 => "#\\\\u[\da-fA-F]{1,8}#i",
69
- ),
70
- 'KEYWORDS' => array(
71
- 1 => array(
72
- 'aqua', 'azimuth', 'background-attachment', 'background-color',
73
- 'background-image', 'background-position', 'background-repeat',
74
- 'background', 'black', 'blue', 'border-bottom-color',
75
- 'border-bottom-style', 'border-bottom-width', 'border-left-color',
76
- 'border-left-style', 'border-left-width', 'border-right',
77
- 'border-right-color', 'border-right-style', 'border-right-width',
78
- 'border-top-color', 'border-top-style',
79
- 'border-top-width','border-bottom', 'border-collapse',
80
- 'border-left', 'border-width', 'border-color', 'border-spacing',
81
- 'border-style', 'border-top', 'border', 'caption-side', 'clear',
82
- 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
83
- 'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
84
- 'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
85
- 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
86
- 'font-weight', 'font', 'line-height', 'letter-spacing',
87
- 'list-style', 'list-style-image', 'list-style-position',
88
- 'list-style-type', 'margin-bottom', 'margin-left', 'margin-right',
89
- 'margin-top', 'margin', 'marker-offset', 'marks', 'max-height',
90
- 'max-width', 'min-height', 'min-width', 'orphans', 'outline',
91
- 'outline-color', 'outline-style', 'outline-width', 'overflow',
92
- 'padding-bottom', 'padding-left', 'padding-right', 'padding-top',
93
- 'padding', 'page', 'page-break-after', 'page-break-before',
94
- 'page-break-inside', 'pause-after', 'pause-before', 'pause',
95
- 'pitch', 'pitch-range', 'play-during', 'position', 'quotes',
96
- 'richness', 'right', 'size', 'speak-header', 'speak-numeral',
97
- 'speak-punctuation', 'speak', 'speech-rate', 'stress',
98
- 'table-layout', 'text-align', 'text-decoration', 'text-indent',
99
- 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
100
- 'vertical-align', 'visibility', 'voice-family', 'volume',
101
- 'white-space', 'widows', 'width', 'word-spacing', 'z-index',
102
- 'bottom', 'left', 'height'
103
- ),
104
- 2 => array(
105
- 'above', 'absolute', 'always', 'armenian', 'aural', 'auto',
106
- 'avoid', 'baseline', 'behind', 'below', 'bidi-override', 'blink',
107
- 'block', 'bold', 'bolder', 'both', 'capitalize', 'center-left',
108
- 'center-right', 'center', 'circle', 'cjk-ideographic',
109
- 'close-quote', 'collapse', 'condensed', 'continuous', 'crop',
110
- 'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero',
111
- 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
112
- 'e-resize', 'embed', 'extra-condensed', 'extra-expanded',
113
- 'expanded', 'fantasy', 'far-left', 'far-right', 'faster', 'fast',
114
- 'fixed', 'fuchsia', 'georgian', 'gray', 'green', 'groove',
115
- 'hebrew', 'help', 'hidden', 'hide', 'higher', 'high',
116
- 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table',
117
- 'inline', 'inset', 'inside', 'invert', 'italic', 'justify',
118
- 'katakana-iroha', 'katakana', 'landscape', 'larger', 'large',
119
- 'left-side', 'leftwards', 'level', 'lighter', 'lime',
120
- 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek',
121
- 'lower-roman', 'lowercase', 'ltr', 'lower', 'low', 'maroon',
122
- 'medium', 'message-box', 'middle', 'mix', 'monospace', 'n-resize',
123
- 'narrower', 'navy', 'ne-resize', 'no-close-quote',
124
- 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap',
125
- 'nw-resize', 'oblique', 'olive', 'once', 'open-quote', 'outset',
126
- 'outside', 'overline', 'pointer', 'portrait', 'purple', 'px',
127
- 'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb',
128
- 'ridge', 'right-side', 'rightwards', 's-resize', 'sans-serif',
129
- 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded',
130
- 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower',
131
- 'small-caps', 'small-caption', 'smaller', 'soft', 'solid',
132
- 'spell-out', 'square', 'static', 'status-bar', 'super',
133
- 'sw-resize', 'table-caption', 'table-cell', 'table-column',
134
- 'table-column-group', 'table-footer-group', 'table-header-group',
135
- 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom',
136
- 'text-top', 'thick', 'thin', 'transparent', 'ultra-condensed',
137
- 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin',
138
- 'upper-roman', 'uppercase', 'url', 'visible', 'w-resize', 'wait',
139
- 'white', 'wider', 'x-fast', 'x-high', 'x-large', 'x-loud',
140
- 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', 'yellow',
141
- 'yes'
142
- )
143
- ),
144
- 'SYMBOLS' => array(
145
- '(', ')', '{', '}', ':', ';',
146
- '>', '+', '*', ',', '^', '='
147
- ),
148
- 'CASE_SENSITIVE' => array(
149
- GESHI_COMMENTS => false,
150
- 1 => true,
151
- 2 => true
152
- ),
153
- 'STYLES' => array(
154
- 'KEYWORDS' => array(
155
- 1 => 'color: #000000; font-weight: bold;',
156
- 2 => 'color: #993333;'
157
- ),
158
- 'COMMENTS' => array(
159
- 1 => 'color: #a1a100;',
160
- 2 => 'color: #ff0000; font-style: italic;',
161
- 'MULTI' => 'color: #808080; font-style: italic;'
162
- ),
163
- 'ESCAPE_CHAR' => array(
164
- 0 => 'color: #000099; font-weight: bold;',
165
- //1 => 'color: #000099; font-weight: bold;',
166
- 2 => 'color: #000099; font-weight: bold;'
167
- //3 => 'color: #000099; font-weight: bold;'
168
- ),
169
- 'BRACKETS' => array(
170
- 0 => 'color: #00AA00;'
171
- ),
172
- 'STRINGS' => array(
173
- 0 => 'color: #ff0000;'
174
- ),
175
- 'NUMBERS' => array(
176
- 0 => 'color: #cc66cc;'
177
- ),
178
- 'METHODS' => array(
179
- ),
180
- 'SYMBOLS' => array(
181
- 0 => 'color: #00AA00;'
182
- ),
183
- 'SCRIPT' => array(
184
- ),
185
- 'REGEXPS' => array(
186
- 0 => 'color: #cc00cc;',
187
- 1 => 'color: #6666ff;',
188
- 2 => 'color: #3333ff;',
189
- 3 => 'color: #933;'
190
- )
191
- ),
192
- 'URLS' => array(
193
- 1 => '',
194
- 2 => ''
195
- ),
196
- 'OOLANG' => false,
197
- 'OBJECT_SPLITTERS' => array(
198
- ),
199
- 'REGEXPS' => array(
200
- //DOM Node ID
201
- 0 => '\#[a-zA-Z0-9\-_]+(?:\\\\:[a-zA-Z0-9\-_]+)*',
202
- //CSS classname
203
- 1 => '\.(?!\d)[a-zA-Z0-9\-_]+(?:\\\\:[a-zA-Z0-9\-_]+)*\b(?=[\{\.#\s,:].|<\|)',
204
- //CSS Pseudo classes
205
- //note: & is needed for &gt; (i.e. > )
206
- 2 => '(?<!\\\\):(?!\d)[a-zA-Z0-9\-]+\b(?:\s*(?=[\{\.#a-zA-Z,:+*&](.|\n)|<\|))',
207
- //Measurements
208
- 3 => '[+\-]?(\d+|(\d*\.\d+))(em|ex|pt|px|cm|in|%)',
209
- ),
210
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
211
- 'SCRIPT_DELIMITERS' => array(
212
- ),
213
- 'HIGHLIGHT_STRICT_BLOCK' => array(
214
- ),
215
- 'TAB_WIDTH' => 4,
216
- 'PARSER_CONTROL' => array(
217
- 'KEYWORDS' => array(
218
- 'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-&\.])'
219
- )
220
- )
221
- );
222
-
223
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/html4strict.php DELETED
@@ -1,190 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * html4strict.php
4
- * ---------------
5
- * Author: Nigel McNie (nigel@geshi.org)
6
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2004/07/10
9
- *
10
- * HTML 4.01 strict language file for GeSHi.
11
- *
12
- * CHANGES
13
- * -------
14
- * 2005/12/28 (1.0.4)
15
- * - Removed escape character for strings
16
- * 2004/11/27 (1.0.3)
17
- * - Added support for multiple object splitters
18
- * 2004/10/27 (1.0.2)
19
- * - Added support for URLs
20
- * 2004/08/05 (1.0.1)
21
- * - Added INS and DEL
22
- * - Removed the background colour from tags' styles
23
- * 2004/07/14 (1.0.0)
24
- * - First Release
25
- *
26
- * TODO (updated 2004/11/27)
27
- * -------------------------
28
- * * Check that only HTML4 strict attributes are highlighted
29
- * * Eliminate empty tags that aren't allowed in HTML4 strict
30
- * * Split to several files - html4trans, xhtml1 etc
31
- *
32
- *************************************************************************************
33
- *
34
- * This file is part of GeSHi.
35
- *
36
- * GeSHi is free software; you can redistribute it and/or modify
37
- * it under the terms of the GNU General Public License as published by
38
- * the Free Software Foundation; either version 2 of the License, or
39
- * (at your option) any later version.
40
- *
41
- * GeSHi is distributed in the hope that it will be useful,
42
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
43
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44
- * GNU General Public License for more details.
45
- *
46
- * You should have received a copy of the GNU General Public License
47
- * along with GeSHi; if not, write to the Free Software
48
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
49
- *
50
- ************************************************************************************/
51
-
52
- $language_data = array (
53
- 'LANG_NAME' => 'HTML',
54
- 'COMMENT_SINGLE' => array(),
55
- 'COMMENT_MULTI' => array(),
56
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
57
- 'QUOTEMARKS' => array("'", '"'),
58
- 'ESCAPE_CHAR' => '',
59
- 'KEYWORDS' => array(
60
- 2 => array(
61
- 'a', 'abbr', 'acronym', 'address', 'applet',
62
- 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b',
63
- 'caption', 'center', 'cite', 'code', 'colgroup', 'col',
64
- 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt',
65
- 'em',
66
- 'fieldset', 'font', 'form', 'frame', 'frameset',
67
- 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html',
68
- 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i',
69
- 'kbd',
70
- 'label', 'legend', 'link', 'li',
71
- 'map', 'meta',
72
- 'noframes', 'noscript',
73
- 'object', 'ol', 'optgroup', 'option',
74
- 'param', 'pre', 'p',
75
- 'q',
76
- 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's',
77
- 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt',
78
- 'ul', 'u',
79
- 'var',
80
- ),
81
- 3 => array(
82
- 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis',
83
- 'background', 'bgcolor', 'border',
84
- 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords',
85
- 'data', 'datetime', 'declare', 'defer', 'dir', 'disabled',
86
- 'enctype',
87
- 'face', 'for', 'frame', 'frameborder',
88
- 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv',
89
- 'id', 'ismap',
90
- 'label', 'lang', 'language', 'link', 'longdesc',
91
- 'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple',
92
- 'name', 'nohref', 'noresize', 'noshade', 'nowrap',
93
- 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', 'onselect', 'onsubmit', 'onunload',
94
- 'profile', 'prompt',
95
- 'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules',
96
- 'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary',
97
- 'tabindex', 'target', 'text', 'title', 'type',
98
- 'usemap',
99
- 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace',
100
- 'width'
101
- )
102
- ),
103
- 'SYMBOLS' => array(
104
- '/', '='
105
- ),
106
- 'CASE_SENSITIVE' => array(
107
- GESHI_COMMENTS => false,
108
- 2 => false,
109
- 3 => false,
110
- ),
111
- 'STYLES' => array(
112
- 'KEYWORDS' => array(
113
- 2 => 'color: #000000; font-weight: bold;',
114
- 3 => 'color: #000066;'
115
- ),
116
- 'COMMENTS' => array(
117
- ),
118
- 'ESCAPE_CHAR' => array(
119
- 0 => 'color: #000099; font-weight: bold;'
120
- ),
121
- 'BRACKETS' => array(
122
- 0 => 'color: #66cc66;'
123
- ),
124
- 'STRINGS' => array(
125
- 0 => 'color: #ff0000;'
126
- ),
127
- 'NUMBERS' => array(
128
- 0 => 'color: #cc66cc;'
129
- ),
130
- 'METHODS' => array(
131
- ),
132
- 'SYMBOLS' => array(
133
- 0 => 'color: #66cc66;'
134
- ),
135
- 'SCRIPT' => array(
136
- -2 => 'color: #404040;', // CDATA
137
- -1 => 'color: #808080; font-style: italic;', // comments
138
- 0 => 'color: #00bbdd;',
139
- 1 => 'color: #ddbb00;',
140
- 2 => 'color: #009900;'
141
- ),
142
- 'REGEXPS' => array(
143
- )
144
- ),
145
- 'URLS' => array(
146
- 2 => 'http://december.com/html/4/element/{FNAMEL}.html',
147
- 3 => ''
148
- ),
149
- 'OOLANG' => false,
150
- 'OBJECT_SPLITTERS' => array(
151
- ),
152
- 'REGEXPS' => array(
153
- ),
154
- 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
155
- 'SCRIPT_DELIMITERS' => array(
156
- -2 => array(
157
- '<![CDATA[' => ']]>'
158
- ),
159
- -1 => array(
160
- '<!--' => '-->'
161
- ),
162
- 0 => array(
163
- '<!DOCTYPE' => '>'
164
- ),
165
- 1 => array(
166
- '&' => ';'
167
- ),
168
- 2 => array(
169
- '<' => '>'
170
- )
171
- ),
172
- 'HIGHLIGHT_STRICT_BLOCK' => array(
173
- -2 => false,
174
- -1 => false,
175
- 0 => false,
176
- 1 => false,
177
- 2 => true
178
- ),
179
- 'TAB_WIDTH' => 4,
180
- 'PARSER_CONTROL' => array(
181
- 'KEYWORDS' => array(
182
- 2 => array(
183
- 'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
184
- 'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
185
- )
186
- )
187
- )
188
- );
189
-
190
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/html5.php DELETED
@@ -1,212 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * html5.php
4
- * ---------------
5
- * Author: Nigel McNie (nigel@geshi.org)
6
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2004/07/10
9
- *
10
- * HTML 4.01 strict language file for GeSHi.
11
- *
12
- * CHANGES
13
- * -------
14
- * 2005/12/28 (1.0.4)
15
- * - Removed escape character for strings
16
- * 2004/11/27 (1.0.3)
17
- * - Added support for multiple object splitters
18
- * 2004/10/27 (1.0.2)
19
- * - Added support for URLs
20
- * 2004/08/05 (1.0.1)
21
- * - Added INS and DEL
22
- * - Removed the background colour from tags' styles
23
- * 2004/07/14 (1.0.0)
24
- * - First Release
25
- *
26
- * TODO (updated 2004/11/27)
27
- * -------------------------
28
- * * Check that only HTML4 strict attributes are highlighted
29
- * * Eliminate empty tags that aren't allowed in HTML4 strict
30
- * * Split to several files - html4trans, xhtml1 etc
31
- *
32
- *************************************************************************************
33
- *
34
- * This file is part of GeSHi.
35
- *
36
- * GeSHi is free software; you can redistribute it and/or modify
37
- * it under the terms of the GNU General Public License as published by
38
- * the Free Software Foundation; either version 2 of the License, or
39
- * (at your option) any later version.
40
- *
41
- * GeSHi is distributed in the hope that it will be useful,
42
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
43
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44
- * GNU General Public License for more details.
45
- *
46
- * You should have received a copy of the GNU General Public License
47
- * along with GeSHi; if not, write to the Free Software
48
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
49
- *
50
- ************************************************************************************/
51
-
52
- $language_data = array (
53
- 'LANG_NAME' => 'HTML',
54
- 'COMMENT_SINGLE' => array(),
55
- 'COMMENT_MULTI' => array(),
56
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
57
- 'QUOTEMARKS' => array("'", '"'),
58
- 'ESCAPE_CHAR' => '',
59
- 'KEYWORDS' => array(
60
- 2 => array(
61
- 'a', 'abbr', 'address', 'article', 'aside', 'audio'.
62
-
63
- 'base', 'bdo', 'blockquote', 'body', 'br', 'button', 'b',
64
-
65
- 'caption', 'cite', 'code', 'colgroup', 'col', 'canvas', 'command', 'datalist', 'details',
66
-
67
- 'dd', 'del', 'dfn', 'div', 'dl', 'dt',
68
-
69
- 'em', 'embed',
70
-
71
- 'fieldset', 'form', 'figcaption', 'figure', 'footer',
72
-
73
- 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html', 'header', 'hgroup',
74
-
75
- 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i',
76
-
77
- 'kbd', 'keygen',
78
-
79
- 'label', 'legend', 'link', 'li',
80
-
81
- 'map', 'meta', 'mark', 'meter',
82
-
83
- 'noscript', 'nav',
84
-
85
- 'object', 'ol', 'optgroup', 'option', 'output',
86
-
87
- 'param', 'pre', 'p', 'progress',
88
-
89
- 'q',
90
-
91
- 'rp', 'rt', 'ruby',
92
-
93
- 'samp', 'script', 'select', 'small', 'span', 'strong', 'style', 'sub', 'sup', 's', 'section', 'source', 'summary',
94
-
95
- 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'time',
96
-
97
- 'ul',
98
-
99
- 'var', 'video',
100
-
101
- 'wbr',
102
- ),
103
- 3 => array(
104
- 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis', 'autocomplete', 'autofocus',
105
- 'background', 'bgcolor', 'border',
106
- 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords', 'contenteditable', 'contextmenu',
107
- 'data', 'datetime', 'declare', 'defer', 'dir', 'disabled', 'draggable', 'dropzone',
108
- 'enctype',
109
- 'face', 'for', 'frame', 'frameborder', 'form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget',
110
- 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv', 'hidden',
111
- 'id', 'ismap',
112
- 'label', 'lang', 'language', 'link', 'longdesc',
113
- 'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple', 'min', 'max',
114
- 'name', 'nohref', 'noresize', 'noshade', 'nowrap', 'novalidate',
115
- 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onselect', 'onsubmit', 'onunload', 'onafterprint', 'onbeforeprint', 'onbeforeonload', 'onerror', 'onhaschange', 'onmessage', 'onoffline', 'ononline', 'onpagehide', 'onpageshow', 'onpopstate', 'onredo', 'onresize', 'onstorage', 'onundo', 'oncontextmenu', 'onformchange', 'onforminput', 'oninput', 'oninvalid', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onmousewheel', 'onscroll', 'oncanplay', 'oncanplaythrough', 'ondurationchange', 'onemptied', 'onended', 'onloadeddata', 'onloadedmetadata', 'onloadstart', 'onpause', 'onplay', 'onplaying', 'onprogress', 'onratechange', 'onreadystatechange', 'onseeked', 'onseeking', 'onstalled', 'onsuspend', 'ontimeupdate', 'onvolumechange', 'onwaiting',
116
- 'profile', 'prompt', 'pattern', 'placeholder',
117
- 'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules', 'required',
118
- 'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary', 'spellcheck', 'step',
119
- 'tabindex', 'target', 'text', 'title', 'type',
120
- 'usemap',
121
- 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace',
122
- 'width'
123
- )
124
- ),
125
- 'SYMBOLS' => array(
126
- '/', '='
127
- ),
128
- 'CASE_SENSITIVE' => array(
129
- GESHI_COMMENTS => false,
130
- 2 => false,
131
- 3 => false,
132
- ),
133
- 'STYLES' => array(
134
- 'KEYWORDS' => array(
135
- 2 => 'color: #000000; font-weight: bold;',
136
- 3 => 'color: #000066;'
137
- ),
138
- 'COMMENTS' => array(
139
- ),
140
- 'ESCAPE_CHAR' => array(
141
- 0 => 'color: #000099; font-weight: bold;'
142
- ),
143
- 'BRACKETS' => array(
144
- 0 => 'color: #66cc66;'
145
- ),
146
- 'STRINGS' => array(
147
- 0 => 'color: #ff0000;'
148
- ),
149
- 'NUMBERS' => array(
150
- 0 => 'color: #cc66cc;'
151
- ),
152
- 'METHODS' => array(
153
- ),
154
- 'SYMBOLS' => array(
155
- 0 => 'color: #66cc66;'
156
- ),
157
- 'SCRIPT' => array(
158
- -2 => 'color: #404040;', // CDATA
159
- -1 => 'color: #808080; font-style: italic;', // comments
160
- 0 => 'color: #00bbdd;',
161
- 1 => 'color: #ddbb00;',
162
- 2 => 'color: #009900;'
163
- ),
164
- 'REGEXPS' => array(
165
- )
166
- ),
167
- 'URLS' => array(
168
- 2 => 'http://december.com/html/4/element/{FNAMEL}.html',
169
- 3 => ''
170
- ),
171
- 'OOLANG' => false,
172
- 'OBJECT_SPLITTERS' => array(
173
- ),
174
- 'REGEXPS' => array(
175
- ),
176
- 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
177
- 'SCRIPT_DELIMITERS' => array(
178
- -2 => array(
179
- '<![CDATA[' => ']]>'
180
- ),
181
- -1 => array(
182
- '<!--' => '-->'
183
- ),
184
- 0 => array(
185
- '<!DOCTYPE' => '>'
186
- ),
187
- 1 => array(
188
- '&' => ';'
189
- ),
190
- 2 => array(
191
- '<' => '>'
192
- )
193
- ),
194
- 'HIGHLIGHT_STRICT_BLOCK' => array(
195
- -2 => false,
196
- -1 => false,
197
- 0 => false,
198
- 1 => false,
199
- 2 => true
200
- ),
201
- 'TAB_WIDTH' => 4,
202
- 'PARSER_CONTROL' => array(
203
- 'KEYWORDS' => array(
204
- 2 => array(
205
- 'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
206
- 'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
207
- )
208
- )
209
- )
210
- );
211
-
212
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/java.php DELETED
@@ -1,983 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * java.php
4
- * --------
5
- * Author: Nigel McNie (nigel@geshi.org)
6
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2004/07/10
9
- *
10
- * Java language file for GeSHi.
11
- *
12
- * CHANGES
13
- * -------
14
- * 2008/05/25 (1.0.7.22)
15
- * - Added highlighting of import and package directives as non-OOP
16
- * 2005/12/28 (1.0.4)
17
- * - Added instanceof keyword
18
- * 2004/11/27 (1.0.3)
19
- * - Added support for multiple object splitters
20
- * 2004/08/05 (1.0.2)
21
- * - Added URL support
22
- * - Added keyword "this", as bugs in GeSHi class ironed out
23
- * 2004/08/05 (1.0.1)
24
- * - Added support for symbols
25
- * - Added extra missed keywords
26
- * 2004/07/14 (1.0.0)
27
- * - First Release
28
- *
29
- * TODO (updated 2004/11/27)
30
- * -------------------------
31
- * * Compact the class names like the first few have been
32
- * and eliminate repeats
33
- *
34
- *************************************************************************************
35
- *
36
- * This file is part of GeSHi.
37
- *
38
- * GeSHi is free software; you can redistribute it and/or modify
39
- * it under the terms of the GNU General Public License as published by
40
- * the Free Software Foundation; either version 2 of the License, or
41
- * (at your option) any later version.
42
- *
43
- * GeSHi is distributed in the hope that it will be useful,
44
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
45
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46
- * GNU General Public License for more details.
47
- *
48
- * You should have received a copy of the GNU General Public License
49
- * along with GeSHi; if not, write to the Free Software
50
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
51
- *
52
- ************************************************************************************/
53
-
54
- $language_data = array (
55
- 'LANG_NAME' => 'Java',
56
- 'COMMENT_SINGLE' => array(1 => '//'),
57
- 'COMMENT_MULTI' => array('/*' => '*/'),
58
- 'COMMENT_REGEXP' => array(
59
- //Import and Package directives (Basic Support only)
60
- 2 => '/(?:(?<=import[\\n\\s])|(?<=package[\\n\\s]))[\\n\\s]*([a-zA-Z0-9_]+\\.)*([a-zA-Z0-9_]+|\*)(?=[\n\s;])/i',
61
- // javadoc comments
62
- 3 => '#/\*\*(?![\*\/]).*\*/#sU'
63
- ),
64
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
65
- 'QUOTEMARKS' => array("'", '"'),
66
- 'ESCAPE_CHAR' => '\\',
67
- 'KEYWORDS' => array(
68
- 1 => array(
69
- 'for', 'foreach', 'if', 'else', 'while', 'do',
70
- 'switch', 'case', 'return', 'public',
71
- 'private', 'protected', 'extends', 'break', 'class',
72
- 'new', 'try', 'catch', 'throws', 'finally', 'implements',
73
- 'interface', 'throw', 'final', 'native', 'synchronized', 'this',
74
- 'abstract', 'transient', 'instanceof', 'assert', 'continue',
75
- 'default', 'enum', 'package', 'static', 'strictfp', 'super',
76
- 'volatile', 'const', 'goto', 'import'
77
- ),
78
- 2 => array(
79
- 'null', 'false', 'true'
80
- ),
81
- 3 => array(
82
- 'AbstractAction', 'AbstractBorder', 'AbstractButton',
83
- 'AbstractCellEditor', 'AbstractCollection',
84
- 'AbstractColorChooserPanel', 'AbstractDocument',
85
- 'AbstractDocument.AttributeContext',
86
- 'AbstractDocument.Content',
87
- 'AbstractDocument.ElementEdit',
88
- 'AbstractLayoutCache',
89
- 'AbstractLayoutCache.NodeDimensions', 'AbstractList',
90
- 'AbstractListModel', 'AbstractMap',
91
- 'AbstractMethodError', 'AbstractSequentialList',
92
- 'AbstractSet', 'AbstractTableModel',
93
- 'AbstractUndoableEdit', 'AbstractWriter',
94
- 'AccessControlContext', 'AccessControlException',
95
- 'AccessController', 'AccessException', 'Accessible',
96
- 'AccessibleAction', 'AccessibleBundle',
97
- 'AccessibleComponent', 'AccessibleContext',
98
- 'AccessibleHyperlink', 'AccessibleHypertext',
99
- 'AccessibleIcon', 'AccessibleObject',
100
- 'AccessibleRelation', 'AccessibleRelationSet',
101
- 'AccessibleResourceBundle', 'AccessibleRole',
102
- 'AccessibleSelection', 'AccessibleState',
103
- 'AccessibleStateSet', 'AccessibleTable',
104
- 'AccessibleTableModelChange', 'AccessibleText',
105
- 'AccessibleValue', 'Acl', 'AclEntry',
106
- 'AclNotFoundException', 'Action', 'ActionEvent',
107
- 'ActionListener', 'ActionMap', 'ActionMapUIResource',
108
- 'Activatable', 'ActivateFailedException',
109
- 'ActivationDesc', 'ActivationException',
110
- 'ActivationGroup', 'ActivationGroupDesc',
111
- 'ActivationGroupDesc.CommandEnvironment',
112
- 'ActivationGroupID', 'ActivationID',
113
- 'ActivationInstantiator', 'ActivationMonitor',
114
- 'ActivationSystem', 'Activator', 'ActiveEvent',
115
- 'Adjustable', 'AdjustmentEvent',
116
- 'AdjustmentListener', 'Adler32', 'AffineTransform',
117
- 'AffineTransformOp', 'AlgorithmParameterGenerator',
118
- 'AlgorithmParameterGeneratorSpi',
119
- 'AlgorithmParameters', 'AlgorithmParameterSpec',
120
- 'AlgorithmParametersSpi', 'AllPermission',
121
- 'AlphaComposite', 'AlreadyBound',
122
- 'AlreadyBoundException', 'AlreadyBoundHelper',
123
- 'AlreadyBoundHolder', 'AncestorEvent',
124
- 'AncestorListener', 'Annotation', 'Any', 'AnyHolder',
125
- 'AnySeqHelper', 'AnySeqHolder', 'Applet',
126
- 'AppletContext', 'AppletInitializer', 'AppletStub',
127
- 'ApplicationException', 'Arc2D', 'Arc2D.Double',
128
- 'Arc2D.Float', 'Area', 'AreaAveragingScaleFilter',
129
- 'ARG_IN', 'ARG_INOUT', 'ARG_OUT',
130
- 'ArithmeticException', 'Array',
131
- 'ArrayIndexOutOfBoundsException', 'ArrayList',
132
- 'Arrays', 'ArrayStoreException', 'AsyncBoxView',
133
- 'Attribute', 'AttributedCharacterIterator',
134
- 'AttributedCharacterIterator.Attribute',
135
- 'AttributedString', 'AttributeInUseException',
136
- 'AttributeList', 'AttributeModificationException',
137
- 'Attributes', 'Attributes.Name', 'AttributeSet',
138
- 'AttributeSet.CharacterAttribute',
139
- 'AttributeSet.ColorAttribute',
140
- 'AttributeSet.FontAttribute',
141
- 'AttributeSet.ParagraphAttribute', 'AudioClip',
142
- 'AudioFileFormat', 'AudioFileFormat.Type',
143
- 'AudioFileReader', 'AudioFileWriter', 'AudioFormat',
144
- 'AudioFormat.Encoding', 'AudioInputStream',
145
- 'AudioPermission', 'AudioSystem',
146
- 'AuthenticationException',
147
- 'AuthenticationNotSupportedException',
148
- 'Authenticator', 'Autoscroll', 'AWTError',
149
- 'AWTEvent', 'AWTEventListener',
150
- 'AWTEventMulticaster', 'AWTException',
151
- 'AWTPermission', 'BadKind', 'BadLocationException',
152
- 'BAD_CONTEXT', 'BAD_INV_ORDER', 'BAD_OPERATION',
153
- 'BAD_PARAM', 'BAD_POLICY', 'BAD_POLICY_TYPE',
154
- 'BAD_POLICY_VALUE', 'BAD_TYPECODE', 'BandCombineOp',
155
- 'BandedSampleModel', 'BasicArrowButton',
156
- 'BasicAttribute', 'BasicAttributes', 'BasicBorders',
157
- 'BasicBorders.ButtonBorder',
158
- 'BasicBorders.FieldBorder',
159
- 'BasicBorders.MarginBorder',
160
- 'BasicBorders.MenuBarBorder',
161
- 'BasicBorders.RadioButtonBorder',
162
- 'BasicBorders.SplitPaneBorder',
163
- 'BasicBorders.ToggleButtonBorder',
164
- 'BasicButtonListener', 'BasicButtonUI',
165
- 'BasicCheckBoxMenuItemUI', 'BasicCheckBoxUI',
166
- 'BasicColorChooserUI', 'BasicComboBoxEditor',
167
- 'BasicComboBoxEditor.UIResource',
168
- 'BasicComboBoxRenderer',
169
- 'BasicComboBoxRenderer.UIResource',
170
- 'BasicComboBoxUI', 'BasicComboPopup',
171
- 'BasicDesktopIconUI', 'BasicDesktopPaneUI',
172
- 'BasicDirectoryModel', 'BasicEditorPaneUI',
173
- 'BasicFileChooserUI', 'BasicGraphicsUtils',
174
- 'BasicHTML', 'BasicIconFactory',
175
- 'BasicInternalFrameTitlePane',
176
- 'BasicInternalFrameUI', 'BasicLabelUI',
177
- 'BasicListUI', 'BasicLookAndFeel', 'BasicMenuBarUI',
178
- 'BasicMenuItemUI', 'BasicMenuUI',
179
- 'BasicOptionPaneUI',
180
- 'BasicOptionPaneUI.ButtonAreaLayout', 'BasicPanelUI',
181
- 'BasicPasswordFieldUI', 'BasicPermission',
182
- 'BasicPopupMenuSeparatorUI', 'BasicPopupMenuUI',
183
- 'BasicProgressBarUI', 'BasicRadioButtonMenuItemUI',
184
- 'BasicRadioButtonUI', 'BasicRootPaneUI',
185
- 'BasicScrollBarUI', 'BasicScrollPaneUI',
186
- 'BasicSeparatorUI', 'BasicSliderUI',
187
- 'BasicSplitPaneDivider', 'BasicSplitPaneUI',
188
- 'BasicStroke', 'BasicTabbedPaneUI',
189
- 'BasicTableHeaderUI', 'BasicTableUI',
190
- 'BasicTextAreaUI', 'BasicTextFieldUI',
191
- 'BasicTextPaneUI', 'BasicTextUI',
192
- 'BasicTextUI.BasicCaret',
193
- 'BasicTextUI.BasicHighlighter',
194
- 'BasicToggleButtonUI', 'BasicToolBarSeparatorUI',
195
- 'BasicToolBarUI', 'BasicToolTipUI', 'BasicTreeUI',
196
- 'BasicViewportUI', 'BatchUpdateException',
197
- 'BeanContext', 'BeanContextChild',
198
- 'BeanContextChildComponentProxy',
199
- 'BeanContextChildSupport',
200
- 'BeanContextContainerProxy', 'BeanContextEvent',
201
- 'BeanContextMembershipEvent',
202
- 'BeanContextMembershipListener', 'BeanContextProxy',
203
- 'BeanContextServiceAvailableEvent',
204
- 'BeanContextServiceProvider',
205
- 'BeanContextServiceProviderBeanInfo',
206
- 'BeanContextServiceRevokedEvent',
207
- 'BeanContextServiceRevokedListener',
208
- 'BeanContextServices', 'BeanContextServicesListener',
209
- 'BeanContextServicesSupport',
210
- 'BeanContextServicesSupport.BCSSServiceProvider',
211
- 'BeanContextSupport',
212
- 'BeanContextSupport.BCSIterator', 'BeanDescriptor',
213
- 'BeanInfo', 'Beans', 'BevelBorder', 'BigDecimal',
214
- 'BigInteger', 'BinaryRefAddr', 'BindException',
215
- 'Binding', 'BindingHelper', 'BindingHolder',
216
- 'BindingIterator', 'BindingIteratorHelper',
217
- 'BindingIteratorHolder', 'BindingIteratorOperations',
218
- 'BindingListHelper', 'BindingListHolder',
219
- 'BindingType', 'BindingTypeHelper',
220
- 'BindingTypeHolder', 'BitSet', 'Blob', 'BlockView',
221
- 'Book', 'Boolean', 'BooleanControl',
222
- 'BooleanControl.Type', 'BooleanHolder',
223
- 'BooleanSeqHelper', 'BooleanSeqHolder', 'Border',
224
- 'BorderFactory', 'BorderLayout', 'BorderUIResource',
225
- 'BorderUIResource.BevelBorderUIResource',
226
- 'BorderUIResource.CompoundBorderUIResource',
227
- 'BorderUIResource.EmptyBorderUIResource',
228
- 'BorderUIResource.EtchedBorderUIResource',
229
- 'BorderUIResource.LineBorderUIResource',
230
- 'BorderUIResource.MatteBorderUIResource',
231
- 'BorderUIResource.TitledBorderUIResource',
232
- 'BoundedRangeModel', 'Bounds', 'Box', 'Box.Filler',
233
- 'BoxedValueHelper', 'BoxLayout', 'BoxView',
234
- 'BreakIterator', 'BufferedImage',
235
- 'BufferedImageFilter', 'BufferedImageOp',
236
- 'BufferedInputStream', 'BufferedOutputStream',
237
- 'BufferedReader', 'BufferedWriter', 'Button',
238
- 'ButtonGroup', 'ButtonModel', 'ButtonUI', 'Byte',
239
- 'ByteArrayInputStream', 'ByteArrayOutputStream',
240
- 'ByteHolder', 'ByteLookupTable', 'Calendar',
241
- 'CallableStatement', 'CannotProceed',
242
- 'CannotProceedException', 'CannotProceedHelper',
243
- 'CannotProceedHolder', 'CannotRedoException',
244
- 'CannotUndoException', 'Canvas', 'CardLayout',
245
- 'Caret', 'CaretEvent', 'CaretListener', 'CellEditor',
246
- 'CellEditorListener', 'CellRendererPane',
247
- 'Certificate', 'Certificate.CertificateRep',
248
- 'CertificateEncodingException',
249
- 'CertificateException',
250
- 'CertificateExpiredException', 'CertificateFactory',
251
- 'CertificateFactorySpi',
252
- 'CertificateNotYetValidException',
253
- 'CertificateParsingException',
254
- 'ChangedCharSetException', 'ChangeEvent',
255
- 'ChangeListener', 'Character', 'Character.Subset',
256
- 'Character.UnicodeBlock', 'CharacterIterator',
257
- 'CharArrayReader', 'CharArrayWriter',
258
- 'CharConversionException', 'CharHolder',
259
- 'CharSeqHelper', 'CharSeqHolder', 'Checkbox',
260
- 'CheckboxGroup', 'CheckboxMenuItem',
261
- 'CheckedInputStream', 'CheckedOutputStream',
262
- 'Checksum', 'Choice', 'ChoiceFormat', 'Class',
263
- 'ClassCastException', 'ClassCircularityError',
264
- 'ClassDesc', 'ClassFormatError', 'ClassLoader',
265
- 'ClassNotFoundException', 'Clip', 'Clipboard',
266
- 'ClipboardOwner', 'Clob', 'Cloneable',
267
- 'CloneNotSupportedException', 'CMMException',
268
- 'CodeSource', 'CollationElementIterator',
269
- 'CollationKey', 'Collator', 'Collection',
270
- 'Collections', 'Color',
271
- 'ColorChooserComponentFactory', 'ColorChooserUI',
272
- 'ColorConvertOp', 'ColorModel',
273
- 'ColorSelectionModel', 'ColorSpace',
274
- 'ColorUIResource', 'ComboBoxEditor', 'ComboBoxModel',
275
- 'ComboBoxUI', 'ComboPopup', 'CommunicationException',
276
- 'COMM_FAILURE', 'Comparable', 'Comparator',
277
- 'Compiler', 'CompletionStatus',
278
- 'CompletionStatusHelper', 'Component',
279
- 'ComponentAdapter', 'ComponentColorModel',
280
- 'ComponentEvent', 'ComponentInputMap',
281
- 'ComponentInputMapUIResource', 'ComponentListener',
282
- 'ComponentOrientation', 'ComponentSampleModel',
283
- 'ComponentUI', 'ComponentView', 'Composite',
284
- 'CompositeContext', 'CompositeName', 'CompositeView',
285
- 'CompoundBorder', 'CompoundControl',
286
- 'CompoundControl.Type', 'CompoundEdit',
287
- 'CompoundName', 'ConcurrentModificationException',
288
- 'ConfigurationException', 'ConnectException',
289
- 'ConnectIOException', 'Connection', 'Constructor', 'Container',
290
- 'ContainerAdapter', 'ContainerEvent',
291
- 'ContainerListener', 'ContentHandler',
292
- 'ContentHandlerFactory', 'ContentModel', 'Context',
293
- 'ContextList', 'ContextNotEmptyException',
294
- 'ContextualRenderedImageFactory', 'Control',
295
- 'Control.Type', 'ControlFactory',
296
- 'ControllerEventListener', 'ConvolveOp', 'CRC32',
297
- 'CRL', 'CRLException', 'CropImageFilter', 'CSS',
298
- 'CSS.Attribute', 'CTX_RESTRICT_SCOPE',
299
- 'CubicCurve2D', 'CubicCurve2D.Double',
300
- 'CubicCurve2D.Float', 'Current', 'CurrentHelper',
301
- 'CurrentHolder', 'CurrentOperations', 'Cursor',
302
- 'Customizer', 'CustomMarshal', 'CustomValue',
303
- 'DatabaseMetaData', 'DataBuffer', 'DataBufferByte',
304
- 'DataBufferInt', 'DataBufferShort',
305
- 'DataBufferUShort', 'DataFlavor',
306
- 'DataFormatException', 'DatagramPacket',
307
- 'DatagramSocket', 'DatagramSocketImpl',
308
- 'DatagramSocketImplFactory', 'DataInput',
309
- 'DataInputStream', 'DataLine', 'DataLine.Info',
310
- 'DataOutput', 'DataOutputStream',
311
- 'DataTruncation', 'DATA_CONVERSION', 'Date',
312
- 'DateFormat', 'DateFormatSymbols', 'DebugGraphics',
313
- 'DecimalFormat', 'DecimalFormatSymbols',
314
- 'DefaultBoundedRangeModel', 'DefaultButtonModel',
315
- 'DefaultCaret', 'DefaultCellEditor',
316
- 'DefaultColorSelectionModel', 'DefaultComboBoxModel',
317
- 'DefaultDesktopManager', 'DefaultEditorKit',
318
- 'DefaultEditorKit.BeepAction',
319
- 'DefaultEditorKit.CopyAction',
320
- 'DefaultEditorKit.CutAction',
321
- 'DefaultEditorKit.DefaultKeyTypedAction',
322
- 'DefaultEditorKit.InsertBreakAction',
323
- 'DefaultEditorKit.InsertContentAction',
324
- 'DefaultEditorKit.InsertTabAction',
325
- 'DefaultEditorKit.PasteAction,',
326
- 'DefaultFocusManager', 'DefaultHighlighter',
327
- 'DefaultHighlighter.DefaultHighlightPainter',
328
- 'DefaultListCellRenderer',
329
- 'DefaultListCellRenderer.UIResource',
330
- 'DefaultListModel', 'DefaultListSelectionModel',
331
- 'DefaultMenuLayout', 'DefaultMetalTheme',
332
- 'DefaultMutableTreeNode',
333
- 'DefaultSingleSelectionModel',
334
- 'DefaultStyledDocument',
335
- 'DefaultStyledDocument.AttributeUndoableEdit',
336
- 'DefaultStyledDocument.ElementSpec',
337
- 'DefaultTableCellRenderer',
338
- 'DefaultTableCellRenderer.UIResource',
339
- 'DefaultTableColumnModel', 'DefaultTableModel',
340
- 'DefaultTextUI', 'DefaultTreeCellEditor',
341
- 'DefaultTreeCellRenderer', 'DefaultTreeModel',
342
- 'DefaultTreeSelectionModel', 'DefinitionKind',
343
- 'DefinitionKindHelper', 'Deflater',
344
- 'DeflaterOutputStream', 'Delegate', 'DesignMode',
345
- 'DesktopIconUI', 'DesktopManager', 'DesktopPaneUI',
346
- 'DGC', 'Dialog', 'Dictionary', 'DigestException',
347
- 'DigestInputStream', 'DigestOutputStream',
348
- 'Dimension', 'Dimension2D', 'DimensionUIResource',
349
- 'DirContext', 'DirectColorModel', 'DirectoryManager',
350
- 'DirObjectFactory', 'DirStateFactory',
351
- 'DirStateFactory.Result', 'DnDConstants', 'Document',
352
- 'DocumentEvent', 'DocumentEvent.ElementChange',
353
- 'DocumentEvent.EventType', 'DocumentListener',
354
- 'DocumentParser', 'DomainCombiner', 'DomainManager',
355
- 'DomainManagerOperations', 'Double', 'DoubleHolder',
356
- 'DoubleSeqHelper', 'DoubleSeqHolder',
357
- 'DragGestureEvent', 'DragGestureListener',
358
- 'DragGestureRecognizer', 'DragSource',
359
- 'DragSourceContext', 'DragSourceDragEvent',
360
- 'DragSourceDropEvent', 'DragSourceEvent',
361
- 'DragSourceListener', 'Driver', 'DriverManager',
362
- 'DriverPropertyInfo', 'DropTarget',
363
- 'DropTarget.DropTargetAutoScroller',
364
- 'DropTargetContext', 'DropTargetDragEvent',
365
- 'DropTargetDropEvent', 'DropTargetEvent',
366
- 'DropTargetListener', 'DSAKey',
367
- 'DSAKeyPairGenerator', 'DSAParameterSpec',
368
- 'DSAParams', 'DSAPrivateKey', 'DSAPrivateKeySpec',
369
- 'DSAPublicKey', 'DSAPublicKeySpec', 'DTD',
370
- 'DTDConstants', 'DynamicImplementation', 'DynAny',
371
- 'DynArray', 'DynEnum', 'DynFixed', 'DynSequence',
372
- 'DynStruct', 'DynUnion', 'DynValue', 'EditorKit',
373
- 'Element', 'ElementIterator', 'Ellipse2D',
374
- 'Ellipse2D.Double', 'Ellipse2D.Float', 'EmptyBorder',
375
- 'EmptyStackException', 'EncodedKeySpec', 'Entity',
376
- 'EnumControl', 'EnumControl.Type', 'Enumeration',
377
- 'Environment', 'EOFException', 'Error',
378
- 'EtchedBorder', 'Event', 'EventContext',
379
- 'EventDirContext', 'EventListener',
380
- 'EventListenerList', 'EventObject', 'EventQueue',
381
- 'EventSetDescriptor', 'Exception',
382
- 'ExceptionInInitializerError', 'ExceptionList',
383
- 'ExpandVetoException', 'ExportException',
384
- 'ExtendedRequest', 'ExtendedResponse',
385
- 'Externalizable', 'FeatureDescriptor', 'Field',
386
- 'FieldNameHelper', 'FieldPosition', 'FieldView',
387
- 'File', 'FileChooserUI', 'FileDescriptor',
388
- 'FileDialog', 'FileFilter',
389
- 'FileInputStream', 'FilenameFilter', 'FileNameMap',
390
- 'FileNotFoundException', 'FileOutputStream',
391
- 'FilePermission', 'FileReader', 'FileSystemView',
392
- 'FileView', 'FileWriter', 'FilteredImageSource',
393
- 'FilterInputStream', 'FilterOutputStream',
394
- 'FilterReader', 'FilterWriter',
395
- 'FixedHeightLayoutCache', 'FixedHolder',
396
- 'FlatteningPathIterator', 'FlavorMap', 'Float',
397
- 'FloatControl', 'FloatControl.Type', 'FloatHolder',
398
- 'FloatSeqHelper', 'FloatSeqHolder', 'FlowLayout',
399
- 'FlowView', 'FlowView.FlowStrategy', 'FocusAdapter',
400
- 'FocusEvent', 'FocusListener', 'FocusManager',
401
- 'Font', 'FontFormatException', 'FontMetrics',
402
- 'FontRenderContext', 'FontUIResource', 'Format',
403
- 'FormatConversionProvider', 'FormView', 'Frame',
404
- 'FREE_MEM', 'GapContent', 'GeneralPath',
405
- 'GeneralSecurityException', 'GlyphJustificationInfo',
406
- 'GlyphMetrics', 'GlyphVector', 'GlyphView',
407
- 'GlyphView.GlyphPainter', 'GradientPaint',
408
- 'GraphicAttribute', 'Graphics', 'Graphics2D',
409
- 'GraphicsConfigTemplate', 'GraphicsConfiguration',
410
- 'GraphicsDevice', 'GraphicsEnvironment',
411
- 'GrayFilter', 'GregorianCalendar',
412
- 'GridBagConstraints', 'GridBagLayout', 'GridLayout',
413
- 'Group', 'Guard', 'GuardedObject', 'GZIPInputStream',
414
- 'GZIPOutputStream', 'HasControls', 'HashMap',
415
- 'HashSet', 'Hashtable', 'HierarchyBoundsAdapter',
416
- 'HierarchyBoundsListener', 'HierarchyEvent',
417
- 'HierarchyListener', 'Highlighter',
418
- 'Highlighter.Highlight',
419
- 'Highlighter.HighlightPainter', 'HTML',
420
- 'HTML.Attribute', 'HTML.Tag', 'HTML.UnknownTag',
421
- 'HTMLDocument', 'HTMLDocument.Iterator',
422
- 'HTMLEditorKit', 'HTMLEditorKit.HTMLFactory',
423
- 'HTMLEditorKit.HTMLTextAction',
424
- 'HTMLEditorKit.InsertHTMLTextAction',
425
- 'HTMLEditorKit.LinkController',
426
- 'HTMLEditorKit.Parser',
427
- 'HTMLEditorKit.ParserCallback',
428
- 'HTMLFrameHyperlinkEvent', 'HTMLWriter',
429
- 'HttpURLConnection', 'HyperlinkEvent',
430
- 'HyperlinkEvent.EventType', 'HyperlinkListener',
431
- 'ICC_ColorSpace', 'ICC_Profile', 'ICC_ProfileGray',
432
- 'ICC_ProfileRGB', 'Icon', 'IconUIResource',
433
- 'IconView', 'IdentifierHelper', 'Identity',
434
- 'IdentityScope', 'IDLEntity', 'IDLType',
435
- 'IDLTypeHelper', 'IDLTypeOperations',
436
- 'IllegalAccessError', 'IllegalAccessException',
437
- 'IllegalArgumentException',
438
- 'IllegalComponentStateException',
439
- 'IllegalMonitorStateException',
440
- 'IllegalPathStateException', 'IllegalStateException',
441
- 'IllegalThreadStateException', 'Image',
442
- 'ImageConsumer', 'ImageFilter',
443
- 'ImageGraphicAttribute', 'ImageIcon',
444
- 'ImageObserver', 'ImageProducer',
445
- 'ImagingOpException', 'IMP_LIMIT',
446
- 'IncompatibleClassChangeError',
447
- 'InconsistentTypeCode', 'IndexColorModel',
448
- 'IndexedPropertyDescriptor',
449
- 'IndexOutOfBoundsException', 'IndirectionException',
450
- 'InetAddress', 'Inflater', 'InflaterInputStream',
451
- 'InheritableThreadLocal', 'InitialContext',
452
- 'InitialContextFactory',
453
- 'InitialContextFactoryBuilder', 'InitialDirContext',
454
- 'INITIALIZE', 'Initializer', 'InitialLdapContext',
455
- 'InlineView', 'InputContext', 'InputEvent',
456
- 'InputMap', 'InputMapUIResource', 'InputMethod',
457
- 'InputMethodContext', 'InputMethodDescriptor',
458
- 'InputMethodEvent', 'InputMethodHighlight',
459
- 'InputMethodListener', 'InputMethodRequests',
460
- 'InputStream',
461
- 'InputStreamReader', 'InputSubset', 'InputVerifier',
462
- 'Insets', 'InsetsUIResource', 'InstantiationError',
463
- 'InstantiationException', 'Instrument',
464
- 'InsufficientResourcesException', 'Integer',
465
- 'INTERNAL', 'InternalError', 'InternalFrameAdapter',
466
- 'InternalFrameEvent', 'InternalFrameListener',
467
- 'InternalFrameUI', 'InterruptedException',
468
- 'InterruptedIOException',
469
- 'InterruptedNamingException', 'INTF_REPOS',
470
- 'IntHolder', 'IntrospectionException',
471
- 'Introspector', 'Invalid',
472
- 'InvalidAlgorithmParameterException',
473
- 'InvalidAttributeIdentifierException',
474
- 'InvalidAttributesException',
475
- 'InvalidAttributeValueException',
476
- 'InvalidClassException',
477
- 'InvalidDnDOperationException',
478
- 'InvalidKeyException', 'InvalidKeySpecException',
479
- 'InvalidMidiDataException', 'InvalidName',
480
- 'InvalidNameException',
481
- 'InvalidNameHelper', 'InvalidNameHolder',
482
- 'InvalidObjectException',
483
- 'InvalidParameterException',
484
- 'InvalidParameterSpecException',
485
- 'InvalidSearchControlsException',
486
- 'InvalidSearchFilterException', 'InvalidSeq',
487
- 'InvalidTransactionException', 'InvalidValue',
488
- 'INVALID_TRANSACTION', 'InvocationEvent',
489
- 'InvocationHandler', 'InvocationTargetException',
490
- 'InvokeHandler', 'INV_FLAG', 'INV_IDENT',
491
- 'INV_OBJREF', 'INV_POLICY', 'IOException',
492
- 'IRObject', 'IRObjectOperations', 'IstringHelper',
493
- 'ItemEvent', 'ItemListener', 'ItemSelectable',
494
- 'Iterator', 'JApplet', 'JarEntry', 'JarException',
495
- 'JarFile', 'JarInputStream', 'JarOutputStream',
496
- 'JarURLConnection', 'JButton', 'JCheckBox',
497
- 'JCheckBoxMenuItem', 'JColorChooser', 'JComboBox',
498
- 'JComboBox.KeySelectionManager', 'JComponent',
499
- 'JDesktopPane', 'JDialog', 'JEditorPane',
500
- 'JFileChooser', 'JFrame', 'JInternalFrame',
501
- 'JInternalFrame.JDesktopIcon', 'JLabel',
502
- 'JLayeredPane', 'JList', 'JMenu', 'JMenuBar',
503
- 'JMenuItem', 'JobAttributes',
504
- 'JobAttributes.DefaultSelectionType',
505
- 'JobAttributes.DestinationType',
506
- 'JobAttributes.DialogType',
507
- 'JobAttributes.MultipleDocumentHandlingType',
508
- 'JobAttributes.SidesType', 'JOptionPane', 'JPanel',
509
- 'JPasswordField', 'JPopupMenu',
510
- 'JPopupMenu.Separator', 'JProgressBar',
511
- 'JRadioButton', 'JRadioButtonMenuItem', 'JRootPane',
512
- 'JScrollBar', 'JScrollPane', 'JSeparator', 'JSlider',
513
- 'JSplitPane', 'JTabbedPane', 'JTable',
514
- 'JTableHeader', 'JTextArea', 'JTextComponent',
515
- 'JTextComponent.KeyBinding', 'JTextField',
516
- 'JTextPane', 'JToggleButton',
517
- 'JToggleButton.ToggleButtonModel', 'JToolBar',
518
- 'JToolBar.Separator', 'JToolTip', 'JTree',
519
- 'JTree.DynamicUtilTreeNode',
520
- 'JTree.EmptySelectionModel', 'JViewport', 'JWindow',
521
- 'Kernel', 'Key', 'KeyAdapter', 'KeyEvent',
522
- 'KeyException', 'KeyFactory', 'KeyFactorySpi',
523
- 'KeyListener', 'KeyManagementException', 'Keymap',
524
- 'KeyPair', 'KeyPairGenerator', 'KeyPairGeneratorSpi',
525
- 'KeySpec', 'KeyStore', 'KeyStoreException',
526
- 'KeyStoreSpi', 'KeyStroke', 'Label', 'LabelUI',
527
- 'LabelView', 'LastOwnerException',
528
- 'LayeredHighlighter',
529
- 'LayeredHighlighter.LayerPainter', 'LayoutManager',
530
- 'LayoutManager2', 'LayoutQueue', 'LdapContext',
531
- 'LdapReferralException', 'Lease',
532
- 'LimitExceededException', 'Line', 'Line.Info',
533
- 'Line2D', 'Line2D.Double', 'Line2D.Float',
534
- 'LineBorder', 'LineBreakMeasurer', 'LineEvent',
535
- 'LineEvent.Type', 'LineListener', 'LineMetrics',
536
- 'LineNumberInputStream', 'LineNumberReader',
537
- 'LineUnavailableException', 'LinkageError',
538
- 'LinkedList', 'LinkException', 'LinkLoopException',
539
- 'LinkRef', 'List', 'ListCellRenderer',
540
- 'ListDataEvent', 'ListDataListener', 'ListIterator',
541
- 'ListModel', 'ListResourceBundle',
542
- 'ListSelectionEvent', 'ListSelectionListener',
543
- 'ListSelectionModel', 'ListUI', 'ListView',
544
- 'LoaderHandler', 'Locale', 'LocateRegistry',
545
- 'LogStream', 'Long', 'LongHolder',
546
- 'LongLongSeqHelper', 'LongLongSeqHolder',
547
- 'LongSeqHelper', 'LongSeqHolder', 'LookAndFeel',
548
- 'LookupOp', 'LookupTable', 'MalformedLinkException',
549
- 'MalformedURLException', 'Manifest', 'Map',
550
- 'Map.Entry', 'MARSHAL', 'MarshalException',
551
- 'MarshalledObject', 'Math', 'MatteBorder',
552
- 'MediaTracker', 'Member', 'MemoryImageSource',
553
- 'Menu', 'MenuBar', 'MenuBarUI', 'MenuComponent',
554
- 'MenuContainer', 'MenuDragMouseEvent',
555
- 'MenuDragMouseListener', 'MenuElement', 'MenuEvent',
556
- 'MenuItem', 'MenuItemUI', 'MenuKeyEvent',
557
- 'MenuKeyListener', 'MenuListener',
558
- 'MenuSelectionManager', 'MenuShortcut',
559
- 'MessageDigest', 'MessageDigestSpi', 'MessageFormat',
560
- 'MetaEventListener', 'MetalBorders',
561
- 'MetalBorders.ButtonBorder',
562
- 'MetalBorders.Flush3DBorder',
563
- 'MetalBorders.InternalFrameBorder',
564
- 'MetalBorders.MenuBarBorder',
565
- 'MetalBorders.MenuItemBorder',
566
- 'MetalBorders.OptionDialogBorder',
567
- 'MetalBorders.PaletteBorder',
568
- 'MetalBorders.PopupMenuBorder',
569
- 'MetalBorders.RolloverButtonBorder',
570
- 'MetalBorders.ScrollPaneBorder',
571
- 'MetalBorders.TableHeaderBorder',
572
- 'MetalBorders.TextFieldBorder',
573
- 'MetalBorders.ToggleButtonBorder',
574
- 'MetalBorders.ToolBarBorder', 'MetalButtonUI',
575
- 'MetalCheckBoxIcon', 'MetalCheckBoxUI',
576
- 'MetalComboBoxButton', 'MetalComboBoxEditor',
577
- 'MetalComboBoxEditor.UIResource',
578
- 'MetalComboBoxIcon', 'MetalComboBoxUI',
579
- 'MetalDesktopIconUI', 'MetalFileChooserUI',
580
- 'MetalIconFactory', 'MetalIconFactory.FileIcon16',
581
- 'MetalIconFactory.FolderIcon16',
582
- 'MetalIconFactory.PaletteCloseIcon',
583
- 'MetalIconFactory.TreeControlIcon',
584
- 'MetalIconFactory.TreeFolderIcon',
585
- 'MetalIconFactory.TreeLeafIcon',
586
- 'MetalInternalFrameTitlePane',
587
- 'MetalInternalFrameUI', 'MetalLabelUI',
588
- 'MetalLookAndFeel', 'MetalPopupMenuSeparatorUI',
589
- 'MetalProgressBarUI', 'MetalRadioButtonUI',
590
- 'MetalScrollBarUI', 'MetalScrollButton',
591
- 'MetalScrollPaneUI', 'MetalSeparatorUI',
592
- 'MetalSliderUI', 'MetalSplitPaneUI',
593
- 'MetalTabbedPaneUI', 'MetalTextFieldUI',
594
- 'MetalTheme', 'MetalToggleButtonUI',
595
- 'MetalToolBarUI', 'MetalToolTipUI', 'MetalTreeUI',
596
- 'MetaMessage', 'Method', 'MethodDescriptor',
597
- 'MidiChannel', 'MidiDevice', 'MidiDevice.Info',
598
- 'MidiDeviceProvider', 'MidiEvent', 'MidiFileFormat',
599
- 'MidiFileReader', 'MidiFileWriter', 'MidiMessage',
600
- 'MidiSystem', 'MidiUnavailableException',
601
- 'MimeTypeParseException', 'MinimalHTMLWriter',
602
- 'MissingResourceException', 'Mixer', 'Mixer.Info',
603
- 'MixerProvider', 'ModificationItem', 'Modifier',
604
- 'MouseAdapter', 'MouseDragGestureRecognizer',
605
- 'MouseEvent', 'MouseInputAdapter',
606
- 'MouseInputListener', 'MouseListener',
607
- 'MouseMotionAdapter', 'MouseMotionListener',
608
- 'MultiButtonUI', 'MulticastSocket',
609
- 'MultiColorChooserUI', 'MultiComboBoxUI',
610
- 'MultiDesktopIconUI', 'MultiDesktopPaneUI',
611
- 'MultiFileChooserUI', 'MultiInternalFrameUI',
612
- 'MultiLabelUI', 'MultiListUI', 'MultiLookAndFeel',
613
- 'MultiMenuBarUI', 'MultiMenuItemUI',
614
- 'MultiOptionPaneUI', 'MultiPanelUI',
615
- 'MultiPixelPackedSampleModel', 'MultipleMaster',
616
- 'MultiPopupMenuUI', 'MultiProgressBarUI',
617
- 'MultiScrollBarUI', 'MultiScrollPaneUI',
618
- 'MultiSeparatorUI', 'MultiSliderUI',
619
- 'MultiSplitPaneUI', 'MultiTabbedPaneUI',
620
- 'MultiTableHeaderUI', 'MultiTableUI', 'MultiTextUI',
621
- 'MultiToolBarUI', 'MultiToolTipUI', 'MultiTreeUI',
622
- 'MultiViewportUI', 'MutableAttributeSet',
623
- 'MutableComboBoxModel', 'MutableTreeNode', 'Name',
624
- 'NameAlreadyBoundException', 'NameClassPair',
625
- 'NameComponent', 'NameComponentHelper',
626
- 'NameComponentHolder', 'NamedValue', 'NameHelper',
627
- 'NameHolder', 'NameNotFoundException', 'NameParser',
628
- 'NamespaceChangeListener', 'NameValuePair',
629
- 'NameValuePairHelper', 'Naming', 'NamingContext',
630
- 'NamingContextHelper', 'NamingContextHolder',
631
- 'NamingContextOperations', 'NamingEnumeration',
632
- 'NamingEvent', 'NamingException',
633
- 'NamingExceptionEvent', 'NamingListener',
634
- 'NamingManager', 'NamingSecurityException',
635
- 'NegativeArraySizeException', 'NetPermission',
636
- 'NoClassDefFoundError', 'NoInitialContextException',
637
- 'NoninvertibleTransformException',
638
- 'NoPermissionException', 'NoRouteToHostException',
639
- 'NoSuchAlgorithmException',
640
- 'NoSuchAttributeException', 'NoSuchElementException',
641
- 'NoSuchFieldError', 'NoSuchFieldException',
642
- 'NoSuchMethodError', 'NoSuchMethodException',
643
- 'NoSuchObjectException', 'NoSuchProviderException',
644
- 'NotActiveException', 'NotBoundException',
645
- 'NotContextException', 'NotEmpty', 'NotEmptyHelper',
646
- 'NotEmptyHolder', 'NotFound', 'NotFoundHelper',
647
- 'NotFoundHolder', 'NotFoundReason',
648
- 'NotFoundReasonHelper', 'NotFoundReasonHolder',
649
- 'NotOwnerException', 'NotSerializableException',
650
- 'NO_IMPLEMENT', 'NO_MEMORY', 'NO_PERMISSION',
651
- 'NO_RESOURCES', 'NO_RESPONSE',
652
- 'NullPointerException', 'Number', 'NumberFormat',
653
- 'NumberFormatException', 'NVList', 'Object',
654
- 'ObjectChangeListener', 'ObjectFactory',
655
- 'ObjectFactoryBuilder', 'ObjectHelper',
656
- 'ObjectHolder', 'ObjectImpl',
657
- 'ObjectInput', 'ObjectInputStream',
658
- 'ObjectInputStream.GetField',
659
- 'ObjectInputValidation', 'ObjectOutput',
660
- 'ObjectOutputStream', 'ObjectOutputStream.PutField',
661
- 'ObjectStreamClass', 'ObjectStreamConstants',
662
- 'ObjectStreamException', 'ObjectStreamField',
663
- 'ObjectView', 'OBJECT_NOT_EXIST', 'ObjID',
664
- 'OBJ_ADAPTER', 'Observable', 'Observer',
665
- 'OctetSeqHelper', 'OctetSeqHolder', 'OMGVMCID',
666
- 'OpenType', 'Operation',
667
- 'OperationNotSupportedException', 'Option',
668
- 'OptionalDataException', 'OptionPaneUI', 'ORB',
669
- 'OutOfMemoryError', 'OutputStream',
670
- 'OutputStreamWriter', 'OverlayLayout', 'Owner',
671
- 'Package', 'PackedColorModel', 'Pageable',
672
- 'PageAttributes', 'PageAttributes.ColorType',
673
- 'PageAttributes.MediaType',
674
- 'PageAttributes.OrientationRequestedType',
675
- 'PageAttributes.OriginType',
676
- 'PageAttributes.PrintQualityType', 'PageFormat',
677
- 'Paint', 'PaintContext', 'PaintEvent', 'Panel',
678
- 'PanelUI', 'Paper', 'ParagraphView',
679
- 'ParameterBlock', 'ParameterDescriptor',
680
- 'ParseException', 'ParsePosition', 'Parser',
681
- 'ParserDelegator', 'PartialResultException',
682
- 'PasswordAuthentication', 'PasswordView', 'Patch',
683
- 'PathIterator', 'Permission',
684
- 'PermissionCollection', 'Permissions',
685
- 'PERSIST_STORE', 'PhantomReference',
686
- 'PipedInputStream', 'PipedOutputStream',
687
- 'PipedReader', 'PipedWriter', 'PixelGrabber',
688
- 'PixelInterleavedSampleModel', 'PKCS8EncodedKeySpec',
689
- 'PlainDocument', 'PlainView', 'Point', 'Point2D',
690
- 'Point2D.Double', 'Point2D.Float', 'Policy',
691
- 'PolicyError', 'PolicyHelper',
692
- 'PolicyHolder', 'PolicyListHelper',
693
- 'PolicyListHolder', 'PolicyOperations',
694
- 'PolicyTypeHelper', 'Polygon', 'PopupMenu',
695
- 'PopupMenuEvent', 'PopupMenuListener', 'PopupMenuUI',
696
- 'Port', 'Port.Info', 'PortableRemoteObject',
697
- 'PortableRemoteObjectDelegate', 'Position',
698
- 'Position.Bias', 'PreparedStatement', 'Principal',
699
- 'PrincipalHolder', 'Printable',
700
- 'PrinterAbortException', 'PrinterException',
701
- 'PrinterGraphics', 'PrinterIOException',
702
- 'PrinterJob', 'PrintGraphics', 'PrintJob',
703
- 'PrintStream', 'PrintWriter', 'PrivateKey',
704
- 'PRIVATE_MEMBER', 'PrivilegedAction',
705
- 'PrivilegedActionException',
706
- 'PrivilegedExceptionAction', 'Process',
707
- 'ProfileDataException', 'ProgressBarUI',
708
- 'ProgressMonitor', 'ProgressMonitorInputStream',
709
- 'Properties', 'PropertyChangeEvent',
710
- 'PropertyChangeListener', 'PropertyChangeSupport',
711
- 'PropertyDescriptor', 'PropertyEditor',
712
- 'PropertyEditorManager', 'PropertyEditorSupport',
713
- 'PropertyPermission', 'PropertyResourceBundle',
714
- 'PropertyVetoException', 'ProtectionDomain',
715
- 'ProtocolException', 'Provider', 'ProviderException',
716
- 'Proxy', 'PublicKey', 'PUBLIC_MEMBER',
717
- 'PushbackInputStream', 'PushbackReader',
718
- 'QuadCurve2D', 'QuadCurve2D.Double',
719
- 'QuadCurve2D.Float', 'Random', 'RandomAccessFile',
720
- 'Raster', 'RasterFormatException', 'RasterOp',
721
- 'Reader', 'Receiver', 'Rectangle', 'Rectangle2D',
722
- 'Rectangle2D.Double', 'Rectangle2D.Float',
723
- 'RectangularShape', 'Ref', 'RefAddr', 'Reference',
724
- 'Referenceable', 'ReferenceQueue',
725
- 'ReferralException', 'ReflectPermission', 'Registry',
726
- 'RegistryHandler', 'RemarshalException', 'Remote',
727
- 'RemoteCall', 'RemoteException', 'RemoteObject',
728
- 'RemoteRef', 'RemoteServer', 'RemoteStub',
729
- 'RenderableImage', 'RenderableImageOp',
730
- 'RenderableImageProducer', 'RenderContext',
731
- 'RenderedImage', 'RenderedImageFactory', 'Renderer',
732
- 'RenderingHints', 'RenderingHints.Key',
733
- 'RepaintManager', 'ReplicateScaleFilter',
734
- 'Repository', 'RepositoryIdHelper', 'Request',
735
- 'RescaleOp', 'Resolver', 'ResolveResult',
736
- 'ResourceBundle', 'ResponseHandler', 'ResultSet',
737
- 'ResultSetMetaData', 'ReverbType', 'RGBImageFilter',
738
- 'RMIClassLoader', 'RMIClientSocketFactory',
739
- 'RMIFailureHandler', 'RMISecurityException',
740
- 'RMISecurityManager', 'RMIServerSocketFactory',
741
- 'RMISocketFactory', 'Robot', 'RootPaneContainer',
742
- 'RootPaneUI', 'RoundRectangle2D',
743
- 'RoundRectangle2D.Double', 'RoundRectangle2D.Float',
744
- 'RowMapper', 'RSAKey', 'RSAKeyGenParameterSpec',
745
- 'RSAPrivateCrtKey', 'RSAPrivateCrtKeySpec',
746
- 'RSAPrivateKey', 'RSAPrivateKeySpec', 'RSAPublicKey',
747
- 'RSAPublicKeySpec', 'RTFEditorKit',
748
- 'RuleBasedCollator', 'Runnable', 'RunTime',
749
- 'Runtime', 'RuntimeException', 'RunTimeOperations',
750
- 'RuntimePermission', 'SampleModel',
751
- 'SchemaViolationException', 'Scrollable',
752
- 'Scrollbar', 'ScrollBarUI', 'ScrollPane',
753
- 'ScrollPaneConstants', 'ScrollPaneLayout',
754
- 'ScrollPaneLayout.UIResource', 'ScrollPaneUI',
755
- 'SearchControls', 'SearchResult',
756
- 'SecureClassLoader', 'SecureRandom',
757
- 'SecureRandomSpi', 'Security', 'SecurityException',
758
- 'SecurityManager', 'SecurityPermission', 'Segment',
759
- 'SeparatorUI', 'Sequence', 'SequenceInputStream',
760
- 'Sequencer', 'Sequencer.SyncMode', 'Serializable',
761
- 'SerializablePermission', 'ServantObject',
762
- 'ServerCloneException', 'ServerError',
763
- 'ServerException', 'ServerNotActiveException',
764
- 'ServerRef', 'ServerRequest',
765
- 'ServerRuntimeException', 'ServerSocket',
766
- 'ServiceDetail', 'ServiceDetailHelper',
767
- 'ServiceInformation', 'ServiceInformationHelper',
768
- 'ServiceInformationHolder',
769
- 'ServiceUnavailableException', 'Set',
770
- 'SetOverrideType', 'SetOverrideTypeHelper', 'Shape',
771
- 'ShapeGraphicAttribute', 'Short', 'ShortHolder',
772
- 'ShortLookupTable', 'ShortMessage', 'ShortSeqHelper',
773
- 'ShortSeqHolder', 'Signature', 'SignatureException',
774
- 'SignatureSpi', 'SignedObject', 'Signer',
775
- 'SimpleAttributeSet', 'SimpleBeanInfo',
776
- 'SimpleDateFormat', 'SimpleTimeZone',
777
- 'SinglePixelPackedSampleModel',
778
- 'SingleSelectionModel', 'SizeLimitExceededException',
779
- 'SizeRequirements', 'SizeSequence', 'Skeleton',
780
- 'SkeletonMismatchException',
781
- 'SkeletonNotFoundException', 'SliderUI', 'Socket',
782
- 'SocketException', 'SocketImpl', 'SocketImplFactory',
783
- 'SocketOptions', 'SocketPermission',
784
- 'SocketSecurityException', 'SoftBevelBorder',
785
- 'SoftReference', 'SortedMap', 'SortedSet',
786
- 'Soundbank', 'SoundbankReader', 'SoundbankResource',
787
- 'SourceDataLine', 'SplitPaneUI', 'SQLData',
788
- 'SQLException', 'SQLInput', 'SQLOutput',
789
- 'SQLPermission', 'SQLWarning', 'Stack',
790
- 'StackOverflowError', 'StateEdit', 'StateEditable',
791
- 'StateFactory', 'Statement', 'Streamable',
792
- 'StreamableValue', 'StreamCorruptedException',
793
- 'StreamTokenizer', 'StrictMath', 'String',
794
- 'StringBuffer', 'StringBufferInputStream',
795
- 'StringCharacterIterator', 'StringContent',
796
- 'StringHolder', 'StringIndexOutOfBoundsException',
797
- 'StringReader', 'StringRefAddr', 'StringSelection',
798
- 'StringTokenizer', 'StringValueHelper',
799
- 'StringWriter', 'Stroke', 'Struct', 'StructMember',
800
- 'StructMemberHelper', 'Stub', 'StubDelegate',
801
- 'StubNotFoundException', 'Style', 'StyleConstants',
802
- 'StyleConstants.CharacterConstants',
803
- 'StyleConstants.ColorConstants',
804
- 'StyleConstants.FontConstants',
805
- 'StyleConstants.ParagraphConstants', 'StyleContext',
806
- 'StyledDocument', 'StyledEditorKit',
807
- 'StyledEditorKit.AlignmentAction',
808
- 'StyledEditorKit.BoldAction',
809
- 'StyledEditorKit.FontFamilyAction',
810
- 'StyledEditorKit.FontSizeAction',
811
- 'StyledEditorKit.ForegroundAction',
812
- 'StyledEditorKit.ItalicAction',
813
- 'StyledEditorKit.StyledTextAction',
814
- 'StyledEditorKit.UnderlineAction', 'StyleSheet',
815
- 'StyleSheet.BoxPainter', 'StyleSheet.ListPainter',
816
- 'SwingConstants', 'SwingPropertyChangeSupport',
817
- 'SwingUtilities', 'SyncFailedException',
818
- 'Synthesizer', 'SysexMessage', 'System',
819
- 'SystemColor', 'SystemException', 'SystemFlavorMap',
820
- 'TabableView', 'TabbedPaneUI', 'TabExpander',
821
- 'TableCellEditor', 'TableCellRenderer',
822
- 'TableColumn', 'TableColumnModel',
823
- 'TableColumnModelEvent', 'TableColumnModelListener',
824
- 'TableHeaderUI', 'TableModel', 'TableModelEvent',
825
- 'TableModelListener', 'TableUI', 'TableView',
826
- 'TabSet', 'TabStop', 'TagElement', 'TargetDataLine',
827
- 'TCKind', 'TextAction', 'TextArea', 'TextAttribute',
828
- 'TextComponent', 'TextEvent', 'TextField',
829
- 'TextHitInfo', 'TextLayout',
830
- 'TextLayout.CaretPolicy', 'TextListener',
831
- 'TextMeasurer', 'TextUI', 'TexturePaint', 'Thread',
832
- 'ThreadDeath', 'ThreadGroup', 'ThreadLocal',
833
- 'Throwable', 'Tie', 'TileObserver', 'Time',
834
- 'TimeLimitExceededException', 'Timer',
835
- 'TimerTask', 'Timestamp', 'TimeZone', 'TitledBorder',
836
- 'ToolBarUI', 'Toolkit', 'ToolTipManager',
837
- 'ToolTipUI', 'TooManyListenersException', 'Track',
838
- 'TransactionRequiredException',
839
- 'TransactionRolledbackException',
840
- 'TRANSACTION_REQUIRED', 'TRANSACTION_ROLLEDBACK',
841
- 'Transferable', 'TransformAttribute', 'TRANSIENT',
842
- 'Transmitter', 'Transparency', 'TreeCellEditor',
843
- 'TreeCellRenderer', 'TreeExpansionEvent',
844
- 'TreeExpansionListener', 'TreeMap', 'TreeModel',
845
- 'TreeModelEvent', 'TreeModelListener', 'TreeNode',
846
- 'TreePath', 'TreeSelectionEvent',
847
- 'TreeSelectionListener', 'TreeSelectionModel',
848
- 'TreeSet', 'TreeUI', 'TreeWillExpandListener',
849
- 'TypeCode', 'TypeCodeHolder', 'TypeMismatch',
850
- 'Types', 'UID', 'UIDefaults',
851
- 'UIDefaults.ActiveValue', 'UIDefaults.LazyInputMap',
852
- 'UIDefaults.LazyValue', 'UIDefaults.ProxyLazyValue',
853
- 'UIManager', 'UIManager.LookAndFeelInfo',
854
- 'UIResource', 'ULongLongSeqHelper',
855
- 'ULongLongSeqHolder', 'ULongSeqHelper',
856
- 'ULongSeqHolder', 'UndeclaredThrowableException',
857
- 'UndoableEdit', 'UndoableEditEvent',
858
- 'UndoableEditListener', 'UndoableEditSupport',
859
- 'UndoManager', 'UnexpectedException',
860
- 'UnicastRemoteObject', 'UnionMember',
861
- 'UnionMemberHelper', 'UNKNOWN', 'UnknownError',
862
- 'UnknownException', 'UnknownGroupException',
863
- 'UnknownHostException',
864
- 'UnknownObjectException', 'UnknownServiceException',
865
- 'UnknownUserException', 'UnmarshalException',
866
- 'UnrecoverableKeyException', 'Unreferenced',
867
- 'UnresolvedPermission', 'UnsatisfiedLinkError',
868
- 'UnsolicitedNotification',
869
- 'UnsolicitedNotificationEvent',
870
- 'UnsolicitedNotificationListener',
871
- 'UnsupportedAudioFileException',
872
- 'UnsupportedClassVersionError',
873
- 'UnsupportedEncodingException',
874
- 'UnsupportedFlavorException',
875
- 'UnsupportedLookAndFeelException',
876
- 'UnsupportedOperationException',
877
- 'UNSUPPORTED_POLICY', 'UNSUPPORTED_POLICY_VALUE',
878
- 'URL', 'URLClassLoader', 'URLConnection',
879
- 'URLDecoder', 'URLEncoder', 'URLStreamHandler',
880
- 'URLStreamHandlerFactory', 'UserException',
881
- 'UShortSeqHelper', 'UShortSeqHolder',
882
- 'UTFDataFormatException', 'Util', 'UtilDelegate',
883
- 'Utilities', 'ValueBase', 'ValueBaseHelper',
884
- 'ValueBaseHolder', 'ValueFactory', 'ValueHandler',
885
- 'ValueMember', 'ValueMemberHelper',
886
- 'VariableHeightLayoutCache', 'Vector', 'VerifyError',
887
- 'VersionSpecHelper', 'VetoableChangeListener',
888
- 'VetoableChangeSupport', 'View', 'ViewFactory',
889
- 'ViewportLayout', 'ViewportUI',
890
- 'VirtualMachineError', 'Visibility',
891
- 'VisibilityHelper', 'VMID', 'VM_ABSTRACT',
892
- 'VM_CUSTOM', 'VM_NONE', 'VM_TRUNCATABLE',
893
- 'VoiceStatus', 'Void', 'WCharSeqHelper',
894
- 'WCharSeqHolder', 'WeakHashMap', 'WeakReference',
895
- 'Window', 'WindowAdapter', 'WindowConstants',
896
- 'WindowEvent', 'WindowListener', 'WrappedPlainView',
897
- 'WritableRaster', 'WritableRenderedImage',
898
- 'WriteAbortedException', 'Writer',
899
- 'WrongTransaction', 'WStringValueHelper',
900
- 'X509Certificate', 'X509CRL', 'X509CRLEntry',
901
- 'X509EncodedKeySpec', 'X509Extension', 'ZipEntry',
902
- 'ZipException', 'ZipFile', 'ZipInputStream',
903
- 'ZipOutputStream', 'ZoneView',
904
- '_BindingIteratorImplBase', '_BindingIteratorStub',
905
- '_IDLTypeStub', '_NamingContextImplBase',
906
- '_NamingContextStub', '_PolicyStub', '_Remote_Stub'
907
- ),
908
- 4 => array(
909
- 'void', 'double', 'int', 'boolean', 'byte', 'short', 'long', 'char', 'float'
910
- )
911
- ),
912
- 'SYMBOLS' => array(
913
- '(', ')', '[', ']', '{', '}',
914
- '+', '-', '*', '/', '%',
915
- '!', '&', '|', '^',
916
- '<', '>', '=',
917
- '?', ':', ';',
918
- ),
919
- 'CASE_SENSITIVE' => array(
920
- GESHI_COMMENTS => false,
921
- 1 => false,
922
- 2 => false,
923
- 3 => true,
924
- 4 => true
925
- ),
926
- 'STYLES' => array(
927
- 'KEYWORDS' => array(
928
- 1 => 'color: #000000; font-weight: bold;',
929
- 2 => 'color: #000066; font-weight: bold;',
930
- 3 => 'color: #003399;',
931
- 4 => 'color: #000066; font-weight: bold;'
932
- ),
933
- 'COMMENTS' => array(
934
- 1 => 'color: #666666; font-style: italic;',
935
- 2 => 'color: #006699;',
936
- 3 => 'color: #008000; font-style: italic; font-weight: bold;',
937
- 3 => 'color: #008000; font-style: italic; font-weight: bold;',
938
- 'MULTI' => 'color: #666666; font-style: italic;'
939
- ),
940
- 'ESCAPE_CHAR' => array(
941
- 0 => 'color: #000099; font-weight: bold;'
942
- ),
943
- 'BRACKETS' => array(
944
- 0 => 'color: #009900;'
945
- ),
946
- 'STRINGS' => array(
947
- 0 => 'color: #0000ff;'
948
- ),
949
- 'NUMBERS' => array(
950
- 0 => 'color: #cc66cc;'
951
- ),
952
- 'METHODS' => array(
953
- 1 => 'color: #006633;',
954
- 2 => 'color: #006633;'
955
- ),
956
- 'SYMBOLS' => array(
957
- 0 => 'color: #339933;'
958
- ),
959
- 'SCRIPT' => array(
960
- ),
961
- 'REGEXPS' => array(
962
- )
963
- ),
964
- 'URLS' => array(
965
- 1 => '',
966
- 2 => '',
967
- 3 => 'http://www.google.com/search?hl=en&amp;q=allinurl%3A{FNAMEL}+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky',
968
- 4 => ''
969
- ),
970
- 'OOLANG' => true,
971
- 'OBJECT_SPLITTERS' => array(
972
- 1 => '.'
973
- ),
974
- 'REGEXPS' => array(
975
- ),
976
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
977
- 'SCRIPT_DELIMITERS' => array(
978
- ),
979
- 'HIGHLIGHT_STRICT_BLOCK' => array(
980
- )
981
- );
982
-
983
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/javascript.php DELETED
@@ -1,152 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * javascript.php
4
- * --------------
5
- * Author: Ben Keen (ben.keen@gmail.com)
6
- * Copyright: (c) 2004 Ben Keen (ben.keen@gmail.com), Nigel McNie (http://qbnz.com/highlighter)
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2004/06/20
9
- *
10
- * JavaScript language file for GeSHi.
11
- *
12
- * CHANGES
13
- * -------
14
- * 2008/05/23 (1.0.7.22)
15
- * - Added description of extra language features (SF#1970248)
16
- * 2004/11/27 (1.0.1)
17
- * - Added support for multiple object splitters
18
- * 2004/10/27 (1.0.0)
19
- * - First Release
20
- *
21
- * TODO (updated 2004/11/27)
22
- * -------------------------
23
- *
24
- *************************************************************************************
25
- *
26
- * This file is part of GeSHi.
27
- *
28
- * GeSHi is free software; you can redistribute it and/or modify
29
- * it under the terms of the GNU General Public License as published by
30
- * the Free Software Foundation; either version 2 of the License, or
31
- * (at your option) any later version.
32
- *
33
- * GeSHi is distributed in the hope that it will be useful,
34
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
35
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36
- * GNU General Public License for more details.
37
- *
38
- * You should have received a copy of the GNU General Public License
39
- * along with GeSHi; if not, write to the Free Software
40
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
41
- *
42
- ************************************************************************************/
43
-
44
- $language_data = array (
45
- 'LANG_NAME' => 'Javascript',
46
- 'COMMENT_SINGLE' => array(1 => '//'),
47
- 'COMMENT_MULTI' => array('/*' => '*/'),
48
- 'COMMENT_REGEXP' => array(
49
- //Regular Expressions
50
- 2 => "/(?<=[\\s^])(s|tr|y)\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])*(?<!\s)\\/[msixpogcde]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])(m|q[qrwx]?)?\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/[msixpogc]*(?=[\\s$\\.\\,\\;\\)])/iU"
51
- ),
52
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
53
- 'QUOTEMARKS' => array("'", '"'),
54
- 'ESCAPE_CHAR' => '\\',
55
- 'KEYWORDS' => array(
56
- 1 => array(
57
- 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
58
- 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
59
- 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
60
- 'while', 'write', 'with'
61
- ),
62
- 2 => array(
63
- 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
64
- 'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
65
- 'protected', 'public', 'super', 'true', 'use', 'var'
66
- ),
67
- 3 => array(
68
- // common functions for Window object
69
- 'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home',
70
- 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
71
- 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status',
72
- 'stop',
73
- )
74
- ),
75
- 'SYMBOLS' => array(
76
- '(', ')', '[', ']', '{', '}',
77
- '+', '-', '*', '/', '%',
78
- '!', '@', '&', '|', '^',
79
- '<', '>', '=',
80
- ',', ';', '?', ':'
81
- ),
82
- 'CASE_SENSITIVE' => array(
83
- GESHI_COMMENTS => false,
84
- 1 => false,
85
- 2 => false,
86
- 3 => false
87
- ),
88
- 'STYLES' => array(
89
- 'KEYWORDS' => array(
90
- 1 => 'color: #000066; font-weight: bold;',
91
- 2 => 'color: #003366; font-weight: bold;',
92
- 3 => 'color: #000066;'
93
- ),
94
- 'COMMENTS' => array(
95
- 1 => 'color: #006600; font-style: italic;',
96
- 2 => 'color: #009966; font-style: italic;',
97
- 'MULTI' => 'color: #006600; font-style: italic;'
98
- ),
99
- 'ESCAPE_CHAR' => array(
100
- 0 => 'color: #000099; font-weight: bold;'
101
- ),
102
- 'BRACKETS' => array(
103
- 0 => 'color: #009900;'
104
- ),
105
- 'STRINGS' => array(
106
- 0 => 'color: #3366CC;'
107
- ),
108
- 'NUMBERS' => array(
109
- 0 => 'color: #CC0000;'
110
- ),
111
- 'METHODS' => array(
112
- 1 => 'color: #660066;'
113
- ),
114
- 'SYMBOLS' => array(
115
- 0 => 'color: #339933;'
116
- ),
117
- 'REGEXPS' => array(
118
- ),
119
- 'SCRIPT' => array(
120
- 0 => '',
121
- 1 => '',
122
- 2 => '',
123
- 3 => ''
124
- )
125
- ),
126
- 'URLS' => array(
127
- 1 => '',
128
- 2 => '',
129
- 3 => ''
130
- ),
131
- 'OOLANG' => true,
132
- 'OBJECT_SPLITTERS' => array(
133
- 1 => '.'
134
- ),
135
- 'REGEXPS' => array(
136
- ),
137
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
138
- 'SCRIPT_DELIMITERS' => array(
139
- 0 => array(
140
- '<script type="text/javascript">' => '</script>'
141
- ),
142
- 1 => array(
143
- '<script language="javascript">' => '</script>'
144
- )
145
- ),
146
- 'HIGHLIGHT_STRICT_BLOCK' => array(
147
- 0 => true,
148
- 1 => true
149
- )
150
- );
151
-
152
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/perl.php DELETED
@@ -1,213 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * perl.php
4
- * --------
5
- * Author: Andreas Gohr (andi@splitbrain.org), Ben Keen (ben.keen@gmail.com)
6
- * Copyright: (c) 2004 Andreas Gohr, Ben Keen (http://www.benjaminkeen.org/), Nigel McNie (http://qbnz.com/highlighter/)
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2004/08/20
9
- *
10
- * Perl language file for GeSHi.
11
- *
12
- * CHANGES
13
- * -------
14
- * 2008/06/22 (1.0.8)
15
- * - Added support for system calls in backticks (Corley Kinnane)
16
- * 2008/05/23 (1.0.7.22)
17
- * - Added description of extra language features (SF#1970248)
18
- * - Added comment_regexp for predefined variables
19
- * 2008/02/15 (1.003)
20
- * - Fixed SF#1891630 with placebo patch
21
- * 2006/01/05 (1.0.2)
22
- * - Used hardescape feature for ' strings (Cliff Stanford)
23
- * 2004/11/27 (1.0.1)
24
- * - Added support for multiple object splitters
25
- * 2004/08/20 (1.0.0)
26
- * - First Release
27
- *
28
- * TODO (updated 2004/11/27)
29
- * -------------------------
30
- * * LABEL:
31
- * * string comparison operators
32
- *
33
- *************************************************************************************
34
- *
35
- * This file is part of GeSHi.
36
- *
37
- * GeSHi is free software; you can redistribute it and/or modify
38
- * it under the terms of the GNU General Public License as published by
39
- * the Free Software Foundation; either version 2 of the License, or
40
- * (at your option) any later version.
41
- *
42
- * GeSHi is distributed in the hope that it will be useful,
43
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
44
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45
- * GNU General Public License for more details.
46
- *
47
- * You should have received a copy of the GNU General Public License
48
- * along with GeSHi; if not, write to the Free Software
49
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
50
- *
51
- ************************************************************************************/
52
-
53
- $language_data = array (
54
- 'LANG_NAME' => 'Perl',
55
- 'COMMENT_SINGLE' => array(1 => '#'),
56
- 'COMMENT_MULTI' => array(
57
- '=back' => '=cut',
58
- '=head' => '=cut',
59
- '=item' => '=cut',
60
- '=over' => '=cut',
61
- '=begin' => '=cut',
62
- '=end' => '=cut',
63
- '=for' => '=cut',
64
- '=encoding' => '=cut',
65
- '=pod' => '=cut'
66
- ),
67
- 'COMMENT_REGEXP' => array(
68
- //Regular expressions
69
- 2 => "/(?<=[\\s^])(s|tr|y)\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/(?:\\\\.|(?!\n)[^\\/\\\\])*\\/[msixpogcde]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])(m|q[qrwx]?)?\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/[msixpogc]*(?=[\\s$\\.\\,\\;\\)])/iU",
70
- //Regular expression match variables
71
- 3 => '/\$\d+/',
72
- //Heredoc
73
- 4 => '/<<\s*?([\'"]?)([a-zA-Z0-9]+)\1;[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU',
74
- //Predefined variables
75
- 5 => '/\$(\^[a-zA-Z]?|[\*\$`\'&_\.,+\-~:;\\\\\/"\|%=\?!@#<>\(\)\[\]])(?!\w)|@[_+\-]|%[!]|\$(?=\{)/',
76
- ),
77
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
78
- 'QUOTEMARKS' => array('"','`'),
79
- 'HARDQUOTE' => array("'", "'"), // An optional 2-element array defining the beginning and end of a hard-quoted string
80
- 'HARDESCAPE' => array('\\\'',),
81
- // Things that must still be escaped inside a hard-quoted string
82
- // If HARDQUOTE is defined, HARDESCAPE must be defined
83
- // This will not work unless the first character of each element is either in the
84
- // QUOTEMARKS array or is the ESCAPE_CHAR
85
- 'ESCAPE_CHAR' => '\\',
86
- 'KEYWORDS' => array(
87
- 1 => array(
88
- 'case', 'do', 'else', 'elsif', 'for', 'if', 'then', 'until', 'while', 'foreach', 'my',
89
- 'xor', 'or', 'and', 'unless', 'next', 'last', 'redo', 'not', 'our',
90
- 'reset', 'continue', 'cmp', 'ne', 'eq', 'lt', 'gt', 'le', 'ge',
91
- ),
92
- 2 => array(
93
- 'use', 'sub', 'new', '__END__', '__DATA__', '__DIE__', '__WARN__', 'BEGIN',
94
- 'STDIN', 'STDOUT', 'STDERR', 'ARGV', 'ARGVOUT'
95
- ),
96
- 3 => array(
97
- 'abs', 'accept', 'alarm', 'atan2', 'bind', 'binmode', 'bless',
98
- 'caller', 'chdir', 'chmod', 'chomp', 'chop', 'chown', 'chr',
99
- 'chroot', 'close', 'closedir', 'connect', 'cos',
100
- 'crypt', 'dbmclose', 'dbmopen', 'defined', 'delete', 'die',
101
- 'dump', 'each', 'endgrent', 'endhostent', 'endnetent', 'endprotoent',
102
- 'endpwent', 'endservent', 'eof', 'eval', 'exec', 'exists', 'exit',
103
- 'exp', 'fcntl', 'fileno', 'flock', 'fork', 'format', 'formline',
104
- 'getc', 'getgrent', 'getgrgid', 'getgrnam', 'gethostbyaddr',
105
- 'gethostbyname', 'gethostent', 'getlogin', 'getnetbyaddr', 'getnetbyname',
106
- 'getnetent', 'getpeername', 'getpgrp', 'getppid', 'getpriority',
107
- 'getprotobyname', 'getprotobynumber', 'getprotoent', 'getpwent',
108
- 'getpwnam', 'getpwuid', 'getservbyname', 'getservbyport', 'getservent',
109
- 'getsockname', 'getsockopt', 'glob', 'gmtime', 'goto', 'grep',
110
- 'hex', 'import', 'index', 'int', 'ioctl', 'join', 'keys', 'kill',
111
- 'lc', 'lcfirst', 'length', 'link', 'listen', 'local',
112
- 'localtime', 'log', 'lstat', 'm', 'map', 'mkdir', 'msgctl', 'msgget',
113
- 'msgrcv', 'msgsnd', 'no', 'oct', 'open', 'opendir',
114
- 'ord', 'pack', 'package', 'pipe', 'pop', 'pos', 'print',
115
- 'printf', 'prototype', 'push', 'qq', 'qr', 'quotemeta', 'qw',
116
- 'qx', 'q', 'rand', 'read', 'readdir', 'readline', 'readlink', 'readpipe',
117
- 'recv', 'ref', 'rename', 'require', 'return',
118
- 'reverse', 'rewinddir', 'rindex', 'rmdir', 's', 'scalar', 'seek',
119
- 'seekdir', 'select', 'semctl', 'semget', 'semop', 'send', 'setgrent',
120
- 'sethostent', 'setnetent', 'setpgrp', 'setpriority', 'setprotoent',
121
- 'setpwent', 'setservent', 'setsockopt', 'shift', 'shmctl', 'shmget',
122
- 'shmread', 'shmwrite', 'shutdown', 'sin', 'sleep', 'socket', 'socketpair',
123
- 'sort', 'splice', 'split', 'sprintf', 'sqrt', 'srand', 'stat',
124
- 'study', 'substr', 'symlink', 'syscall', 'sysopen', 'sysread',
125
- 'sysseek', 'system', 'syswrite', 'tell', 'telldir', 'tie', 'tied',
126
- 'time', 'times', 'tr', 'truncate', 'uc', 'ucfirst', 'umask', 'undef',
127
- 'unlink', 'unpack', 'unshift', 'untie', 'utime', 'values',
128
- 'vec', 'wait', 'waitpid', 'wantarray', 'warn', 'write', 'y'
129
- )
130
- ),
131
- 'SYMBOLS' => array(
132
- '<', '>', '=',
133
- '!', '@', '~', '&', '|', '^',
134
- '+','-', '*', '/', '%',
135
- ',', ';', '?', '.', ':'
136
- ),
137
- 'CASE_SENSITIVE' => array(
138
- GESHI_COMMENTS => false,
139
- 1 => true,
140
- 2 => true,
141
- 3 => true,
142
- ),
143
- 'STYLES' => array(
144
- 'KEYWORDS' => array(
145
- 1 => 'color: #b1b100;',
146
- 2 => 'color: #000000; font-weight: bold;',
147
- 3 => 'color: #000066;'
148
- ),
149
- 'COMMENTS' => array(
150
- 1 => 'color: #666666; font-style: italic;',
151
- 2 => 'color: #009966; font-style: italic;',
152
- 3 => 'color: #0000ff;',
153
- 4 => 'color: #cc0000; font-style: italic;',
154
- 5 => 'color: #0000ff;',
155
- 'MULTI' => 'color: #666666; font-style: italic;'
156
- ),
157
- 'ESCAPE_CHAR' => array(
158
- 0 => 'color: #000099; font-weight: bold;',
159
- 'HARD' => 'color: #000099; font-weight: bold;'
160
- ),
161
- 'BRACKETS' => array(
162
- 0 => 'color: #009900;'
163
- ),
164
- 'STRINGS' => array(
165
- 0 => 'color: #ff0000;',
166
- 'HARD' => 'color: #ff0000;'
167
- ),
168
- 'NUMBERS' => array(
169
- 0 => 'color: #cc66cc;'
170
- ),
171
- 'METHODS' => array(
172
- 1 => 'color: #006600;',
173
- 2 => 'color: #006600;'
174
- ),
175
- 'SYMBOLS' => array(
176
- 0 => 'color: #339933;'
177
- ),
178
- 'REGEXPS' => array(
179
- 0 => 'color: #0000ff;',
180
- 4 => 'color: #009999;',
181
- ),
182
- 'SCRIPT' => array(
183
- )
184
- ),
185
- 'URLS' => array(
186
- 1 => '',
187
- 2 => '',
188
- 3 => 'http://perldoc.perl.org/functions/{FNAMEL}.html'
189
- ),
190
- 'OOLANG' => true,
191
- 'OBJECT_SPLITTERS' => array(
192
- 1 => '-&gt;',
193
- 2 => '::'
194
- ),
195
- 'REGEXPS' => array(
196
- //Variable
197
- 0 => '(?:\$[\$#]?|\\\\(?:[@%*]?|\\\\*\$|&amp;)|%[$]?|@[$]?|\*[$]?|&amp;[$]?)[a-zA-Z_][a-zA-Z0-9_]*',
198
- //File Descriptor
199
- 4 => '&lt;[a-zA-Z_][a-zA-Z0-9_]*&gt;',
200
- ),
201
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
202
- 'SCRIPT_DELIMITERS' => array(
203
- ),
204
- 'HIGHLIGHT_STRICT_BLOCK' => array(
205
- ),
206
- 'PARSER_CONTROL' => array(
207
- 'COMMENTS' => array(
208
- 'DISALLOWED_BEFORE' => '$'
209
- )
210
- )
211
- );
212
-
213
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/php-brief.php DELETED
@@ -1,222 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * php-brief.php
4
- * -------------
5
- * Author: Nigel McNie (nigel@geshi.org)
6
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2004/06/02
9
- *
10
- * PHP (brief version) language file for GeSHi.
11
- *
12
- * CHANGES
13
- * -------
14
- * 2008/05/23 (1.0.7.22)
15
- * - Added description of extra language features (SF#1970248)
16
- * 2004/11/27 (1.0.3)
17
- * - Added support for multiple object splitters
18
- * - Fixed &new problem
19
- * 2004/10/27 (1.0.2)
20
- * - Added support for URLs
21
- * 2004/08/05 (1.0.1)
22
- * - Added support for symbols
23
- * 2004/07/14 (1.0.0)
24
- * - First Release
25
- *
26
- * TODO (updated 2004/07/14)
27
- * -------------------------
28
- * * Remove more functions that are hardly used
29
- *
30
- *************************************************************************************
31
- *
32
- * This file is part of GeSHi.
33
- *
34
- * GeSHi is free software; you can redistribute it and/or modify
35
- * it under the terms of the GNU General Public License as published by
36
- * the Free Software Foundation; either version 2 of the License, or
37
- * (at your option) any later version.
38
- *
39
- * GeSHi is distributed in the hope that it will be useful,
40
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
41
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42
- * GNU General Public License for more details.
43
- *
44
- * You should have received a copy of the GNU General Public License
45
- * along with GeSHi; if not, write to the Free Software
46
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
47
- *
48
- ************************************************************************************/
49
-
50
- $language_data = array (
51
- 'LANG_NAME' => 'PHP (brief)',
52
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
53
- 'COMMENT_MULTI' => array('/*' => '*/'),
54
- //Heredoc and Nowdoc syntax
55
- 'COMMENT_REGEXP' => array(3 => '/<<<\s*?(\'?)([a-zA-Z0-9]+)\1[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU'),
56
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
57
- 'QUOTEMARKS' => array("'", '"'),
58
- 'ESCAPE_CHAR' => '\\',
59
- 'HARDQUOTE' => array("'", "'"),
60
- 'HARDESCAPE' => array("\'"),
61
- 'NUMBERS' =>
62
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX |
63
- GESHI_NUMBER_FLT_SCI_ZERO,
64
- 'KEYWORDS' => array(
65
- 1 => array(
66
- 'include', 'require', 'include_once', 'require_once',
67
- 'for', 'as', 'foreach', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', 'endif', 'switch', 'case', 'endswitch',
68
- 'return', 'break'
69
- ),
70
- 2 => array(
71
- 'null', '__LINE__', '__FILE__',
72
- 'false', '&lt;?php',
73
- 'true', 'var', 'default',
74
- 'function', 'class', 'new', '&amp;new', 'public', 'private', 'interface', 'extends',
75
- 'const', 'self'
76
- ),
77
- 3 => array(
78
- 'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
79
- 'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
80
- 'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
81
- 'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv',
82
- 'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime',
83
- 'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar',
84
- 'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewinddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown',
85
- 'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate',
86
- 'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
87
- 'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_insert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat',
88
- 'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from',
89
- 'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport',
90
- 'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
91
- )
92
- ),
93
- 'SYMBOLS' => array(
94
- 1 => array(
95
- '<%', '<%=', '%>', '<?', '<?=', '?>'
96
- ),
97
- 0 => array(
98
- '(', ')', '[', ']', '{', '}',
99
- '!', '@', '%', '&', '|', '/',
100
- '<', '>',
101
- '=', '-', '+', '*',
102
- '.', ':', ',', ';'
103
- )
104
- ),
105
- 'CASE_SENSITIVE' => array(
106
- GESHI_COMMENTS => false,
107
- 1 => false,
108
- 2 => false,
109
- 3 => false
110
- ),
111
- 'STYLES' => array(
112
- 'KEYWORDS' => array(
113
- 1 => 'color: #b1b100;',
114
- 2 => 'color: #000000; font-weight: bold;',
115
- 3 => 'color: #990000;'
116
- ),
117
- 'COMMENTS' => array(
118
- 1 => 'color: #666666; font-style: italic;',
119
- 2 => 'color: #666666; font-style: italic;',
120
- 3 => 'color: #0000cc; font-style: italic;',
121
- 'MULTI' => 'color: #666666; font-style: italic;'
122
- ),
123
- 'ESCAPE_CHAR' => array(
124
- 0 => 'color: #000099; font-weight: bold;',
125
- 'HARD' => 'color: #000099; font-weight: bold;'
126
- ),
127
- 'BRACKETS' => array(
128
- 0 => 'color: #009900;'
129
- ),
130
- 'STRINGS' => array(
131
- 0 => 'color: #0000ff;',
132
- 'HARD' => 'color: #0000ff;'
133
- ),
134
- 'NUMBERS' => array(
135
- 0 => 'color: #cc66cc;',
136
- GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
137
- GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
138
- GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
139
- ),
140
- 'METHODS' => array(
141
- 1 => 'color: #004000;',
142
- 2 => 'color: #004000;'
143
- ),
144
- 'SYMBOLS' => array(
145
- 0 => 'color: #339933;',
146
- 1 => 'color: #000000; font-weight: bold;'
147
- ),
148
- 'REGEXPS' => array(
149
- 0 => 'color: #0000ff;'
150
- ),
151
- 'SCRIPT' => array(
152
- 0 => '',
153
- 1 => '',
154
- 2 => '',
155
- 3 => '',
156
- 4 => '',
157
- 5 => ''
158
- )
159
- ),
160
- 'URLS' => array(
161
- 1 => '',
162
- 2 => '',
163
- 3 => 'http://www.php.net/{FNAMEL}'
164
- ),
165
- 'OOLANG' => true,
166
- 'OBJECT_SPLITTERS' => array(
167
- 1 => '-&gt;',
168
- 2 => '::'
169
- ),
170
- 'REGEXPS' => array(
171
- //Variables
172
- 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*"
173
- ),
174
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
175
- 'SCRIPT_DELIMITERS' => array(
176
- 0 => array(
177
- '<?php' => '?>'
178
- ),
179
- 1 => array(
180
- '<?' => '?>'
181
- ),
182
- 2 => array(
183
- '<%' => '%>'
184
- ),
185
- 3 => array(
186
- '<script language="php">' => '</script>'
187
- ),
188
- 4 => "/(?P<start><\\?(?>php\b)?)(?:".
189
- "(?>[^\"'?\\/<]+)|".
190
- "\\?(?!>)|".
191
- "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|".
192
- "(?>\"(?>[^\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
193
- "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
194
- "\\/\\/(?>.*?$)|".
195
- "\\/(?=[^*\\/])|".
196
- "<(?!<<)|".
197
- "<<<(?P<phpdoc>\w+)\s.*?\s\k<phpdoc>".
198
- ")*(?P<end>\\?>|\Z)/sm",
199
- 5 => "/(?P<start><%)(?:".
200
- "(?>[^\"'%\\/<]+)|".
201
- "%(?!>)|".
202
- "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|".
203
- "(?>\"(?>[^\\\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
204
- "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
205
- "\\/\\/(?>.*?$)|".
206
- "\\/(?=[^*\\/])|".
207
- "<(?!<<)|".
208
- "<<<(?P<phpdoc>\w+)\s.*?\s\k<phpdoc>".
209
- ")*(?P<end>%>)/sm"
210
- ),
211
- 'HIGHLIGHT_STRICT_BLOCK' => array(
212
- 0 => true,
213
- 1 => true,
214
- 2 => true,
215
- 3 => true,
216
- 4 => true,
217
- 5 => true
218
- ),
219
- 'TAB_WIDTH' => 4
220
- );
221
-
222
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/php.php DELETED
@@ -1,1114 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * php.php
4
- * --------
5
- * Author: Nigel McNie (nigel@geshi.org)
6
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2004/06/20
9
- *
10
- * PHP language file for GeSHi.
11
- *
12
- * CHANGES
13
- * -------
14
- * 2008/05/23 (1.0.7.22)
15
- * - Added description of extra language features (SF#1970248)
16
- * 2004/11/25 (1.0.3)
17
- * - Added support for multiple object splitters
18
- * - Fixed &new problem
19
- * 2004/10/27 (1.0.2)
20
- * - Added URL support
21
- * - Added extra constants
22
- * 2004/08/05 (1.0.1)
23
- * - Added support for symbols
24
- * 2004/07/14 (1.0.0)
25
- * - First Release
26
- *
27
- * TODO (updated 2004/07/14)
28
- * -------------------------
29
- * * Make sure the last few function I may have missed
30
- * (like eval()) are included for highlighting
31
- * * Split to several files - php4, php5 etc
32
- *
33
- *************************************************************************************
34
- *
35
- * This file is part of GeSHi.
36
- *
37
- * GeSHi is free software; you can redistribute it and/or modify
38
- * it under the terms of the GNU General Public License as published by
39
- * the Free Software Foundation; either version 2 of the License, or
40
- * (at your option) any later version.
41
- *
42
- * GeSHi is distributed in the hope that it will be useful,
43
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
44
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45
- * GNU General Public License for more details.
46
- *
47
- * You should have received a copy of the GNU General Public License
48
- * along with GeSHi; if not, write to the Free Software
49
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
50
- *
51
- ************************************************************************************/
52
-
53
- $language_data = array(
54
- 'LANG_NAME' => 'PHP',
55
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
56
- 'COMMENT_MULTI' => array('/*' => '*/'),
57
- 'COMMENT_REGEXP' => array(
58
- //Heredoc and Nowdoc syntax
59
- 3 => '/<<<\s*?(\'?)([a-zA-Z0-9]+?)\1[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU',
60
- // phpdoc comments
61
- 4 => '#/\*\*(?![\*\/]).*\*/#sU',
62
- // Advanced # handling
63
- 2 => "/#.*?(?:(?=\?\>)|^)/smi"
64
- ),
65
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
66
- 'QUOTEMARKS' => array('"'),
67
- 'ESCAPE_CHAR' => '',
68
- 'ESCAPE_REGEXP' => array(
69
- //Simple Single Char Escapes
70
- 1 => "#\\\\[nfrtv\$\"\n\\\\]#i",
71
- //Hexadecimal Char Specs
72
- 2 => "#\\\\x[\da-fA-F]{1,2}#i",
73
- //Octal Char Specs
74
- 3 => "#\\\\[0-7]{1,3}#",
75
- //String Parsing of Variable Names
76
- 4 => "#\\$[a-z0-9_]+(?:\\[[a-z0-9_]+\\]|->[a-z0-9_]+)?|(?:\\{\\$|\\$\\{)[a-z0-9_]+(?:\\[('?)[a-z0-9_]*\\1\\]|->[a-z0-9_]+)*\\}#i",
77
- //Experimental extension supporting cascaded {${$var}} syntax
78
- 5 => "#\$[a-z0-9_]+(?:\[[a-z0-9_]+\]|->[a-z0-9_]+)?|(?:\{\$|\$\{)[a-z0-9_]+(?:\[('?)[a-z0-9_]*\\1\]|->[a-z0-9_]+)*\}|\{\$(?R)\}#i",
79
- //Format String support in ""-Strings
80
- 6 => "#%(?:%|(?:\d+\\\\\\\$)?\\+?(?:\x20|0|'.)?-?(?:\d+|\\*)?(?:\.\d+)?[bcdefFosuxX])#"
81
- ),
82
- 'HARDQUOTE' => array("'", "'"),
83
- 'HARDESCAPE' => array("'", "\\"),
84
- 'HARDCHAR' => "\\",
85
- 'NUMBERS' =>
86
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX |
87
- GESHI_NUMBER_FLT_SCI_ZERO,
88
- 'KEYWORDS' => array(
89
- 1 => array(
90
- 'as','break','case','continue','default','do','else','elseif',
91
- 'endfor','endforeach','endif','endswitch','endwhile','for',
92
- 'foreach','if','include','include_once','require','require_once',
93
- 'return','switch','throw','while',
94
-
95
- 'echo','print'
96
- ),
97
- 2 => array(
98
- '&amp;new','&lt;/script&gt;','&lt;?php','&lt;script language',
99
- 'class','const','declare','extends','function','global','interface',
100
- 'namespace','new','private','protected','public','self','use','var'
101
- ),
102
- 3 => array(
103
- 'abs','acos','acosh','addcslashes','addslashes','aggregate',
104
- 'aggregate_methods','aggregate_methods_by_list',
105
- 'aggregate_methods_by_regexp','aggregate_properties',
106
- 'aggregate_properties_by_list','aggregate_properties_by_regexp',
107
- 'aggregation_info','apache_child_terminate','apache_get_modules',
108
- 'apache_get_version','apache_getenv','apache_lookup_uri',
109
- 'apache_note','apache_request_headers','apache_response_headers',
110
- 'apache_setenv','array','array_change_key_case','array_chunk',
111
- 'array_combine','array_count_values','array_diff',
112
- 'array_diff_assoc','array_diff_key','array_diff_uassoc',
113
- 'array_diff_ukey','array_fill','array_fill_keys','array_filter',
114
- 'array_flip','array_intersect','array_intersect_assoc',
115
- 'array_intersect_key','array_intersect_uassoc',
116
- 'array_intersect_ukey','array_key_exists','array_keys','array_map',
117
- 'array_merge','array_merge_recursive','array_multisort','array_pad',
118
- 'array_pop','array_product','array_push','array_rand',
119
- 'array_reduce','array_reverse','array_search','array_shift',
120
- 'array_slice','array_splice','array_sum','array_udiff',
121
- 'array_udiff_assoc','array_udiff_uassoc','array_uintersect',
122
- 'array_uintersect_assoc','array_uintersect_uassoc','array_unique',
123
- 'array_unshift','array_values','array_walk','array_walk_recursive',
124
- 'arsort','asin','asinh','asort','assert','assert_options','atan',
125
- 'atan2','atanh','base_convert','base64_decode','base64_encode',
126
- 'basename','bcadd','bccomp','bcdiv','bcmod','bcmul',
127
- 'bcompiler_load','bcompiler_load_exe','bcompiler_parse_class',
128
- 'bcompiler_read','bcompiler_write_class','bcompiler_write_constant',
129
- 'bcompiler_write_exe_footer','bcompiler_write_file',
130
- 'bcompiler_write_footer','bcompiler_write_function',
131
- 'bcompiler_write_functions_from_file','bcompiler_write_header',
132
- 'bcompiler_write_included_filename','bcpow','bcpowmod','bcscale',
133
- 'bcsqrt','bcsub','bin2hex','bindec','bindtextdomain',
134
- 'bind_textdomain_codeset','bitset_empty','bitset_equal',
135
- 'bitset_excl','bitset_fill','bitset_from_array','bitset_from_hash',
136
- 'bitset_from_string','bitset_in','bitset_incl',
137
- 'bitset_intersection','bitset_invert','bitset_is_empty',
138
- 'bitset_subset','bitset_to_array','bitset_to_hash',
139
- 'bitset_to_string','bitset_union','blenc_encrypt','bzclose',
140
- 'bzcompress','bzdecompress','bzerrno','bzerror','bzerrstr',
141
- 'bzflush','bzopen','bzread','bzwrite','cal_days_in_month',
142
- 'cal_from_jd','cal_info','cal_to_jd','call_user_func',
143
- 'call_user_func_array','call_user_method','call_user_method_array',
144
- 'ceil','chdir','checkdate','checkdnsrr','chgrp','chmod','chop',
145
- 'chown','chr','chunk_split','class_exists','class_implements',
146
- 'class_parents','classkit_aggregate_methods',
147
- 'classkit_doc_comments','classkit_import','classkit_method_add',
148
- 'classkit_method_copy','classkit_method_redefine',
149
- 'classkit_method_remove','classkit_method_rename','clearstatcache',
150
- 'closedir','closelog','com_create_guid','com_event_sink',
151
- 'com_get_active_object','com_load_typelib','com_message_pump',
152
- 'com_print_typeinfo','compact','confirm_phpdoc_compiled',
153
- 'connection_aborted','connection_status','constant',
154
- 'convert_cyr_string','convert_uudecode','convert_uuencode','copy',
155
- 'cos','cosh','count','count_chars','cpdf_add_annotation',
156
- 'cpdf_add_outline','cpdf_arc','cpdf_begin_text','cpdf_circle',
157
- 'cpdf_clip','cpdf_close','cpdf_closepath',
158
- 'cpdf_closepath_fill_stroke','cpdf_closepath_stroke',
159
- 'cpdf_continue_text','cpdf_curveto','cpdf_end_text','cpdf_fill',
160
- 'cpdf_fill_stroke','cpdf_finalize','cpdf_finalize_page',
161
- 'cpdf_global_set_document_limits','cpdf_import_jpeg','cpdf_lineto',
162
- 'cpdf_moveto','cpdf_newpath','cpdf_open','cpdf_output_buffer',
163
- 'cpdf_page_init','cpdf_rect','cpdf_restore','cpdf_rlineto',
164
- 'cpdf_rmoveto','cpdf_rotate','cpdf_rotate_text','cpdf_save',
165
- 'cpdf_save_to_file','cpdf_scale','cpdf_set_action_url',
166
- 'cpdf_set_char_spacing','cpdf_set_creator','cpdf_set_current_page',
167
- 'cpdf_set_font','cpdf_set_font_directories',
168
- 'cpdf_set_font_map_file','cpdf_set_horiz_scaling',
169
- 'cpdf_set_keywords','cpdf_set_leading','cpdf_set_page_animation',
170
- 'cpdf_set_subject','cpdf_set_text_matrix','cpdf_set_text_pos',
171
- 'cpdf_set_text_rendering','cpdf_set_text_rise','cpdf_set_title',
172
- 'cpdf_set_viewer_preferences','cpdf_set_word_spacing',
173
- 'cpdf_setdash','cpdf_setflat','cpdf_setgray','cpdf_setgray_fill',
174
- 'cpdf_setgray_stroke','cpdf_setlinecap','cpdf_setlinejoin',
175
- 'cpdf_setlinewidth','cpdf_setmiterlimit','cpdf_setrgbcolor',
176
- 'cpdf_setrgbcolor_fill','cpdf_setrgbcolor_stroke','cpdf_show',
177
- 'cpdf_show_xy','cpdf_stringwidth','cpdf_stroke','cpdf_text',
178
- 'cpdf_translate','crack_check','crack_closedict',
179
- 'crack_getlastmessage','crack_opendict','crc32','create_function',
180
- 'crypt','ctype_alnum','ctype_alpha','ctype_cntrl','ctype_digit',
181
- 'ctype_graph','ctype_lower','ctype_print','ctype_punct',
182
- 'ctype_space','ctype_upper','ctype_xdigit','curl_close',
183
- 'curl_copy_handle','curl_errno','curl_error','curl_exec',
184
- 'curl_getinfo','curl_init','curl_multi_add_handle',
185
- 'curl_multi_close','curl_multi_exec','curl_multi_getcontent',
186
- 'curl_multi_info_read','curl_multi_init','curl_multi_remove_handle',
187
- 'curl_multi_select','curl_setopt','curl_setopt_array',
188
- 'curl_version','current','cvsclient_connect','cvsclient_log',
189
- 'cvsclient_login','cvsclient_retrieve','date','date_create',
190
- 'date_date_set','date_default_timezone_get',
191
- 'date_default_timezone_set','date_format','date_isodate_set',
192
- 'date_modify','date_offset_get','date_parse','date_sun_info',
193
- 'date_sunrise','date_sunset','date_time_set','date_timezone_get',
194
- 'date_timezone_set','db_id_list','dba_close','dba_delete',
195
- 'dba_exists','dba_fetch','dba_firstkey','dba_handlers','dba_insert',
196
- 'dba_key_split','dba_list','dba_nextkey','dba_open','dba_optimize',
197
- 'dba_popen','dba_replace','dba_sync','dbase_add_record',
198
- 'dbase_close','dbase_create','dbase_delete_record',
199
- 'dbase_get_header_info','dbase_get_record',
200
- 'dbase_get_record_with_names','dbase_numfields','dbase_numrecords',
201
- 'dbase_open','dbase_pack','dbase_replace_record',
202
- 'dbg_get_all_contexts','dbg_get_all_module_names',
203
- 'dbg_get_all_source_lines','dbg_get_context_name',
204
- 'dbg_get_module_name','dbg_get_profiler_results',
205
- 'dbg_get_source_context','dblist','dbmclose','dbmdelete',
206
- 'dbmexists','dbmfetch','dbmfirstkey','dbminsert','dbmnextkey',
207
- 'dbmopen','dbmreplace','dbx_close','dbx_compare','dbx_connect',
208
- 'dbx_error','dbx_escape_string','dbx_fetch_row','dbx_query',
209
- 'dbx_sort','dcgettext','dcngettext','deaggregate','debug_backtrace',
210
- 'debug_zval_dump','debugbreak','decbin','dechex','decoct','define',
211
- 'defined','define_syslog_variables','deg2rad','dgettext','die',
212
- 'dio_close','dio_open','dio_read','dio_seek','dio_stat','dio_write',
213
- 'dir','dirname','disk_free_space','disk_total_space',
214
- 'diskfreespace','dl','dngettext','docblock_token_name',
215
- 'docblock_tokenize','dom_import_simplexml','domxml_add_root',
216
- 'domxml_attributes','domxml_children','domxml_doc_add_root',
217
- 'domxml_doc_document_element','domxml_doc_get_element_by_id',
218
- 'domxml_doc_get_elements_by_tagname','domxml_doc_get_root',
219
- 'domxml_doc_set_root','domxml_doc_validate','domxml_doc_xinclude',
220
- 'domxml_dump_mem','domxml_dump_mem_file','domxml_dump_node',
221
- 'domxml_dumpmem','domxml_elem_get_attribute',
222
- 'domxml_elem_set_attribute','domxml_get_attribute','domxml_getattr',
223
- 'domxml_html_dump_mem','domxml_new_child','domxml_new_doc',
224
- 'domxml_new_xmldoc','domxml_node','domxml_node_add_namespace',
225
- 'domxml_node_attributes','domxml_node_children',
226
- 'domxml_node_get_content','domxml_node_has_attributes',
227
- 'domxml_node_new_child','domxml_node_set_content',
228
- 'domxml_node_set_namespace','domxml_node_unlink_node',
229
- 'domxml_open_file','domxml_open_mem','domxml_parser',
230
- 'domxml_parser_add_chunk','domxml_parser_cdata_section',
231
- 'domxml_parser_characters','domxml_parser_comment',
232
- 'domxml_parser_end','domxml_parser_end_document',
233
- 'domxml_parser_end_element','domxml_parser_entity_reference',
234
- 'domxml_parser_get_document','domxml_parser_namespace_decl',
235
- 'domxml_parser_processing_instruction',
236
- 'domxml_parser_start_document','domxml_parser_start_element',
237
- 'domxml_root','domxml_set_attribute','domxml_setattr',
238
- 'domxml_substitute_entities_default','domxml_unlink_node',
239
- 'domxml_version','domxml_xmltree','doubleval','each','easter_date',
240
- 'easter_days','empty','end','ereg','ereg_replace','eregi',
241
- 'eregi_replace','error_get_last','error_log','error_reporting',
242
- 'escapeshellarg','escapeshellcmd','eval','event_deschedule',
243
- 'event_dispatch','event_free','event_handle_signal',
244
- 'event_have_events','event_init','event_new','event_pending',
245
- 'event_priority_set','event_schedule','event_set','event_timeout',
246
- 'exec','exif_imagetype','exif_read_data','exif_tagname',
247
- 'exif_thumbnail','exit','exp','explode','expm1','extension_loaded',
248
- 'extract','ezmlm_hash','fbird_add_user','fbird_affected_rows',
249
- 'fbird_backup','fbird_blob_add','fbird_blob_cancel',
250
- 'fbird_blob_close','fbird_blob_create','fbird_blob_echo',
251
- 'fbird_blob_get','fbird_blob_import','fbird_blob_info',
252
- 'fbird_blob_open','fbird_close','fbird_commit','fbird_commit_ret',
253
- 'fbird_connect','fbird_db_info','fbird_delete_user','fbird_drop_db',
254
- 'fbird_errcode','fbird_errmsg','fbird_execute','fbird_fetch_assoc',
255
- 'fbird_fetch_object','fbird_fetch_row','fbird_field_info',
256
- 'fbird_free_event_handler','fbird_free_query','fbird_free_result',
257
- 'fbird_gen_id','fbird_maintain_db','fbird_modify_user',
258
- 'fbird_name_result','fbird_num_fields','fbird_num_params',
259
- 'fbird_param_info','fbird_pconnect','fbird_prepare','fbird_query',
260
- 'fbird_restore','fbird_rollback','fbird_rollback_ret',
261
- 'fbird_server_info','fbird_service_attach','fbird_service_detach',
262
- 'fbird_set_event_handler','fbird_trans','fbird_wait_event','fclose',
263
- 'fdf_add_doc_javascript','fdf_add_template','fdf_close',
264
- 'fdf_create','fdf_enum_values','fdf_errno','fdf_error','fdf_get_ap',
265
- 'fdf_get_attachment','fdf_get_encoding','fdf_get_file',
266
- 'fdf_get_flags','fdf_get_opt','fdf_get_status','fdf_get_value',
267
- 'fdf_get_version','fdf_header','fdf_next_field_name','fdf_open',
268
- 'fdf_open_string','fdf_remove_item','fdf_save','fdf_save_string',
269
- 'fdf_set_ap','fdf_set_encoding','fdf_set_file','fdf_set_flags',
270
- 'fdf_set_javascript_action','fdf_set_on_import_javascript',
271
- 'fdf_set_opt','fdf_set_status','fdf_set_submit_form_action',
272
- 'fdf_set_target_frame','fdf_set_value','fdf_set_version','feof',
273
- 'fflush','fgetc','fgetcsv','fgets','fgetss','file','file_exists',
274
- 'file_get_contents','file_put_contents','fileatime','filectime',
275
- 'filegroup','fileinode','filemtime','fileowner','fileperms',
276
- 'filepro','filepro_fieldcount','filepro_fieldname',
277
- 'filepro_fieldtype','filepro_fieldwidth','filepro_retrieve',
278
- 'filepro_rowcount','filesize','filetype','filter_has_var',
279
- 'filter_id','filter_input','filter_input_array','filter_list',
280
- 'filter_var','filter_var_array','finfo_buffer','finfo_close',
281
- 'finfo_file','finfo_open','finfo_set_flags','floatval','flock',
282
- 'floor','flush','fmod','fnmatch','fopen','fpassthru','fprintf',
283
- 'fputcsv','fputs','fread','frenchtojd','fribidi_charset_info',
284
- 'fribidi_get_charsets','fribidi_log2vis','fscanf','fseek',
285
- 'fsockopen','fstat','ftell','ftok','ftp_alloc','ftp_cdup',
286
- 'ftp_chdir','ftp_chmod','ftp_close','ftp_connect','ftp_delete',
287
- 'ftp_exec','ftp_fget','ftp_fput','ftp_get','ftp_get_option',
288
- 'ftp_login','ftp_mdtm','ftp_mkdir','ftp_nb_continue','ftp_nb_fget',
289
- 'ftp_nb_fput','ftp_nb_get','ftp_nb_put','ftp_nlist','ftp_pasv',
290
- 'ftp_put','ftp_pwd','ftp_quit','ftp_raw','ftp_rawlist','ftp_rename',
291
- 'ftp_rmdir','ftp_set_option','ftp_site','ftp_size',
292
- 'ftp_ssl_connect','ftp_systype','ftruncate','function_exists',
293
- 'func_get_arg','func_get_args','func_num_args','fwrite','gd_info',
294
- 'getallheaders','getcwd','getdate','getenv','gethostbyaddr',
295
- 'gethostbyname','gethostbynamel','getimagesize','getlastmod',
296
- 'getmxrr','getmygid','getmyinode','getmypid','getmyuid','getopt',
297
- 'getprotobyname','getprotobynumber','getrandmax','getrusage',
298
- 'getservbyname','getservbyport','gettext','gettimeofday','gettype',
299
- 'get_browser','get_cfg_var','get_class','get_class_methods',
300
- 'get_class_vars','get_current_user','get_declared_classes',
301
- 'get_defined_constants','get_defined_functions','get_defined_vars',
302
- 'get_extension_funcs','get_headers','get_html_translation_table',
303
- 'get_included_files','get_include_path','get_loaded_extensions',
304
- 'get_magic_quotes_gpc','get_magic_quotes_runtime','get_meta_tags',
305
- 'get_object_vars','get_parent_class','get_required_files',
306
- 'get_resource_type','glob','gmdate','gmmktime','gmp_abs','gmp_add',
307
- 'gmp_and','gmp_clrbit','gmp_cmp','gmp_com','gmp_div','gmp_div_q',
308
- 'gmp_div_qr','gmp_div_r','gmp_divexact','gmp_fact','gmp_gcd',
309
- 'gmp_gcdext','gmp_hamdist','gmp_init','gmp_intval','gmp_invert',
310
- 'gmp_jacobi','gmp_legendre','gmp_mod','gmp_mul','gmp_neg',
311
- 'gmp_nextprime','gmp_or','gmp_perfect_square','gmp_popcount',
312
- 'gmp_pow','gmp_powm','gmp_prob_prime','gmp_random','gmp_scan0',
313
- 'gmp_scan1','gmp_setbit','gmp_sign','gmp_sqrt','gmp_sqrtrem',
314
- 'gmp_strval','gmp_sub','gmp_xor','gmstrftime','gopher_parsedir',
315
- 'gregoriantojd','gzclose','gzcompress','gzdeflate','gzencode',
316
- 'gzeof','gzfile','gzgetc','gzgets','gzgetss','gzinflate','gzopen',
317
- 'gzpassthru','gzputs','gzread','gzrewind','gzseek','gztell',
318
- 'gzuncompress','gzwrite','hash','hash_algos','hash_file',
319
- 'hash_final','hash_hmac','hash_hmac_file','hash_init','hash_update',
320
- 'hash_update_file','hash_update_stream','header','headers_list',
321
- 'headers_sent','hebrev','hebrevc','hexdec','highlight_file',
322
- 'highlight_string','html_doc','html_doc_file','html_entity_decode',
323
- 'htmlentities','htmlspecialchars','htmlspecialchars_decode',
324
- 'http_build_cookie','http_build_query','http_build_str',
325
- 'http_build_url','http_cache_etag','http_cache_last_modified',
326
- 'http_chunked_decode','http_date','http_deflate','http_get',
327
- 'http_get_request_body','http_get_request_body_stream',
328
- 'http_get_request_headers','http_head','http_inflate',
329
- 'http_match_etag','http_match_modified','http_match_request_header',
330
- 'http_negotiate_charset','http_negotiate_content_type',
331
- 'http_negotiate_language','http_parse_cookie','http_parse_headers',
332
- 'http_parse_message','http_parse_params',
333
- 'http_persistent_handles_clean','http_persistent_handles_count',
334
- 'http_persistent_handles_ident','http_post_data','http_post_fields',
335
- 'http_put_data','http_put_file','http_put_stream','http_redirect',
336
- 'http_request','http_request_body_encode',
337
- 'http_request_method_exists','http_request_method_name',
338
- 'http_request_method_register','http_request_method_unregister',
339
- 'http_send_content_disposition','http_send_content_type',
340
- 'http_send_data','http_send_file','http_send_last_modified',
341
- 'http_send_status','http_send_stream','http_support',
342
- 'http_throttle','hypot','i18n_convert','i18n_discover_encoding',
343
- 'i18n_http_input','i18n_http_output','i18n_internal_encoding',
344
- 'i18n_ja_jp_hantozen','i18n_mime_header_decode',
345
- 'i18n_mime_header_encode','ibase_add_user','ibase_affected_rows',
346
- 'ibase_backup','ibase_blob_add','ibase_blob_cancel',
347
- 'ibase_blob_close','ibase_blob_create','ibase_blob_echo',
348
- 'ibase_blob_get','ibase_blob_import','ibase_blob_info',
349
- 'ibase_blob_open','ibase_close','ibase_commit','ibase_commit_ret',
350
- 'ibase_connect','ibase_db_info','ibase_delete_user','ibase_drop_db',
351
- 'ibase_errcode','ibase_errmsg','ibase_execute','ibase_fetch_assoc',
352
- 'ibase_fetch_object','ibase_fetch_row','ibase_field_info',
353
- 'ibase_free_event_handler','ibase_free_query','ibase_free_result',
354
- 'ibase_gen_id','ibase_maintain_db','ibase_modify_user',
355
- 'ibase_name_result','ibase_num_fields','ibase_num_params',
356
- 'ibase_param_info','ibase_pconnect','ibase_prepare','ibase_query',
357
- 'ibase_restore','ibase_rollback','ibase_rollback_ret',
358
- 'ibase_server_info','ibase_service_attach','ibase_service_detach',
359
- 'ibase_set_event_handler','ibase_trans','ibase_wait_event','iconv',
360
- 'iconv_get_encoding','iconv_mime_decode',
361
- 'iconv_mime_decode_headers','iconv_mime_encode',
362
- 'iconv_set_encoding','iconv_strlen','iconv_strpos','iconv_strrpos',
363
- 'iconv_substr','id3_get_frame_long_name','id3_get_frame_short_name',
364
- 'id3_get_genre_id','id3_get_genre_list','id3_get_genre_name',
365
- 'id3_get_tag','id3_get_version','id3_remove_tag','id3_set_tag',
366
- 'idate','ignore_user_abort','image_type_to_extension',
367
- 'image_type_to_mime_type','image2wbmp','imagealphablending',
368
- 'imageantialias','imagearc','imagechar','imagecharup',
369
- 'imagecolorallocate','imagecolorallocatealpha','imagecolorat',
370
- 'imagecolorclosest','imagecolorclosestalpha','imagecolordeallocate',
371
- 'imagecolorexact','imagecolorexactalpha','imagecolormatch',
372
- 'imagecolorresolve','imagecolorresolvealpha','imagecolorset',
373
- 'imagecolorsforindex','imagecolorstotal','imagecolortransparent',
374
- 'imageconvolution','imagecopy','imagecopymerge',
375
- 'imagecopymergegray','imagecopyresampled','imagecopyresized',
376
- 'imagecreate','imagecreatefromgd','imagecreatefromgd2',
377
- 'imagecreatefromgd2part','imagecreatefromgif','imagecreatefromjpeg',
378
- 'imagecreatefrompng','imagecreatefromstring','imagecreatefromwbmp',
379
- 'imagecreatefromxbm','imagecreatetruecolor','imagedashedline',
380
- 'imagedestroy','imageellipse','imagefill','imagefilledarc',
381
- 'imagefilledellipse','imagefilledpolygon','imagefilledrectangle',
382
- 'imagefilltoborder','imagefilter','imagefontheight',
383
- 'imagefontwidth','imageftbbox','imagefttext','imagegammacorrect',
384
- 'imagegd','imagegd2','imagegif','imagegrabscreen','imagegrabwindow',
385
- 'imageinterlace','imageistruecolor','imagejpeg','imagelayereffect',
386
- 'imageline','imageloadfont','imagepalettecopy','imagepng',
387
- 'imagepolygon','imagepsbbox','imagepsencodefont',
388
- 'imagepsextendfont','imagepsfreefont','imagepsloadfont',
389
- 'imagepsslantfont','imagepstext','imagerectangle','imagerotate',
390
- 'imagesavealpha','imagesetbrush','imagesetpixel','imagesetstyle',
391
- 'imagesetthickness','imagesettile','imagestring','imagestringup',
392
- 'imagesx','imagesy','imagetruecolortopalette','imagettfbbox',
393
- 'imagettftext','imagetypes','imagewbmp','imagexbm','imap_8bit',
394
- 'imap_alerts','imap_append','imap_base64','imap_binary','imap_body',
395
- 'imap_bodystruct','imap_check','imap_clearflag_full','imap_close',
396
- 'imap_create','imap_createmailbox','imap_delete',
397
- 'imap_deletemailbox','imap_errors','imap_expunge',
398
- 'imap_fetch_overview','imap_fetchbody','imap_fetchheader',
399
- 'imap_fetchstructure','imap_fetchtext','imap_get_quota',
400
- 'imap_get_quotaroot','imap_getacl','imap_getmailboxes',
401
- 'imap_getsubscribed','imap_header','imap_headerinfo','imap_headers',
402
- 'imap_last_error','imap_list','imap_listmailbox',
403
- 'imap_listsubscribed','imap_lsub','imap_mail','imap_mail_compose',
404
- 'imap_mail_copy','imap_mail_move','imap_mailboxmsginfo',
405
- 'imap_mime_header_decode','imap_msgno','imap_num_msg',
406
- 'imap_num_recent','imap_open','imap_ping','imap_qprint',
407
- 'imap_rename','imap_renamemailbox','imap_reopen',
408
- 'imap_rfc822_parse_adrlist','imap_rfc822_parse_headers',
409
- 'imap_rfc822_write_address','imap_savebody','imap_scan',
410
- 'imap_scanmailbox','imap_search','imap_set_quota','imap_setacl',
411
- 'imap_setflag_full','imap_sort','imap_status','imap_subscribe',
412
- 'imap_thread','imap_timeout','imap_uid','imap_undelete',
413
- 'imap_unsubscribe','imap_utf7_decode','imap_utf7_encode',
414
- 'imap_utf8','implode','import_request_variables','in_array',
415
- 'ini_alter','ini_get','ini_get_all','ini_restore','ini_set',
416
- 'intval','ip2long','iptcembed','iptcparse','isset','is_a',
417
- 'is_array','is_bool','is_callable','is_dir','is_double',
418
- 'is_executable','is_file','is_finite','is_float','is_infinite',
419
- 'is_int','is_integer','is_link','is_long','is_nan','is_null',
420
- 'is_numeric','is_object','is_readable','is_real','is_resource',
421
- 'is_scalar','is_soap_fault','is_string','is_subclass_of',
422
- 'is_uploaded_file','is_writable','is_writeable','iterator_apply',
423
- 'iterator_count','iterator_to_array','java_last_exception_clear',
424
- 'java_last_exception_get','jddayofweek','jdmonthname','jdtofrench',
425
- 'jdtogregorian','jdtojewish','jdtojulian','jdtounix','jewishtojd',
426
- 'join','jpeg2wbmp','json_decode','json_encode','juliantojd','key',
427
- 'key_exists','krsort','ksort','lcg_value','ldap_add','ldap_bind',
428
- 'ldap_close','ldap_compare','ldap_connect','ldap_count_entries',
429
- 'ldap_delete','ldap_dn2ufn','ldap_err2str','ldap_errno',
430
- 'ldap_error','ldap_explode_dn','ldap_first_attribute',
431
- 'ldap_first_entry','ldap_first_reference','ldap_free_result',
432
- 'ldap_get_attributes','ldap_get_dn','ldap_get_entries',
433
- 'ldap_get_option','ldap_get_values','ldap_get_values_len',
434
- 'ldap_list','ldap_mod_add','ldap_mod_del','ldap_mod_replace',
435
- 'ldap_modify','ldap_next_attribute','ldap_next_entry',
436
- 'ldap_next_reference','ldap_parse_reference','ldap_parse_result',
437
- 'ldap_read','ldap_rename','ldap_search','ldap_set_option',
438
- 'ldap_sort','ldap_start_tls','ldap_unbind','levenshtein',
439
- 'libxml_clear_errors','libxml_get_errors','libxml_get_last_error',
440
- 'libxml_set_streams_context','libxml_use_internal_errors','link',
441
- 'linkinfo','list','localeconv','localtime','log','log1p','log10',
442
- 'long2ip','lstat','ltrim','lzf_compress','lzf_decompress',
443
- 'lzf_optimized_for','magic_quotes_runtime','mail','max','mbereg',
444
- 'mberegi','mberegi_replace','mbereg_match','mbereg_replace',
445
- 'mbereg_search','mbereg_search_getpos','mbereg_search_getregs',
446
- 'mbereg_search_init','mbereg_search_pos','mbereg_search_regs',
447
- 'mbereg_search_setpos','mbregex_encoding','mbsplit','mbstrcut',
448
- 'mbstrlen','mbstrpos','mbstrrpos','mbsubstr','mb_check_encoding',
449
- 'mb_convert_case','mb_convert_encoding','mb_convert_kana',
450
- 'mb_convert_variables','mb_decode_mimeheader',
451
- 'mb_decode_numericentity','mb_detect_encoding','mb_detect_order',
452
- 'mb_encode_mimeheader','mb_encode_numericentity','mb_ereg',
453
- 'mb_eregi','mb_eregi_replace','mb_ereg_match','mb_ereg_replace',
454
- 'mb_ereg_search','mb_ereg_search_getpos','mb_ereg_search_getregs',
455
- 'mb_ereg_search_init','mb_ereg_search_pos','mb_ereg_search_regs',
456
- 'mb_ereg_search_setpos','mb_get_info','mb_http_input',
457
- 'mb_http_output','mb_internal_encoding','mb_language',
458
- 'mb_list_encodings','mb_output_handler','mb_parse_str',
459
- 'mb_preferred_mime_name','mb_regex_encoding','mb_regex_set_options',
460
- 'mb_send_mail','mb_split','mb_strcut','mb_strimwidth','mb_stripos',
461
- 'mb_stristr','mb_strlen','mb_strpos','mb_strrchr','mb_strrichr',
462
- 'mb_strripos','mb_strrpos','mb_strstr','mb_strtolower',
463
- 'mb_strtoupper','mb_strwidth','mb_substitute_character','mb_substr',
464
- 'mb_substr_count','mcrypt_cbc','mcrypt_cfb','mcrypt_create_iv',
465
- 'mcrypt_decrypt','mcrypt_ecb','mcrypt_enc_get_algorithms_name',
466
- 'mcrypt_enc_get_block_size','mcrypt_enc_get_iv_size',
467
- 'mcrypt_enc_get_key_size','mcrypt_enc_get_modes_name',
468
- 'mcrypt_enc_get_supported_key_sizes',
469
- 'mcrypt_enc_is_block_algorithm',
470
- 'mcrypt_enc_is_block_algorithm_mode','mcrypt_enc_is_block_mode',
471
- 'mcrypt_enc_self_test','mcrypt_encrypt','mcrypt_generic',
472
- 'mcrypt_generic_deinit','mcrypt_generic_end','mcrypt_generic_init',
473
- 'mcrypt_get_block_size','mcrypt_get_cipher_name',
474
- 'mcrypt_get_iv_size','mcrypt_get_key_size','mcrypt_list_algorithms',
475
- 'mcrypt_list_modes','mcrypt_module_close',
476
- 'mcrypt_module_get_algo_block_size',
477
- 'mcrypt_module_get_algo_key_size',
478
- 'mcrypt_module_get_supported_key_sizes',
479
- 'mcrypt_module_is_block_algorithm',
480
- 'mcrypt_module_is_block_algorithm_mode',
481
- 'mcrypt_module_is_block_mode','mcrypt_module_open',
482
- 'mcrypt_module_self_test','mcrypt_ofb','md5','md5_file',
483
- 'mdecrypt_generic','memcache_add','memcache_add_server',
484
- 'memcache_close','memcache_connect','memcache_debug',
485
- 'memcache_decrement','memcache_delete','memcache_flush',
486
- 'memcache_get','memcache_get_extended_stats',
487
- 'memcache_get_server_status','memcache_get_stats',
488
- 'memcache_get_version','memcache_increment','memcache_pconnect',
489
- 'memcache_replace','memcache_set','memcache_set_compress_threshold',
490
- 'memcache_set_server_params','memory_get_peak_usage',
491
- 'memory_get_usage','metaphone','mhash','mhash_count',
492
- 'mhash_get_block_size','mhash_get_hash_name','mhash_keygen_s2k',
493
- 'method_exists','microtime','mime_content_type','min',
494
- 'ming_keypress','ming_setcubicthreshold','ming_setscale',
495
- 'ming_useconstants','ming_useswfversion','mkdir','mktime',
496
- 'money_format','move_uploaded_file','msql','msql_affected_rows',
497
- 'msql_close','msql_connect','msql_create_db','msql_createdb',
498
- 'msql_data_seek','msql_db_query','msql_dbname','msql_drop_db',
499
- 'msql_dropdb','msql_error','msql_fetch_array','msql_fetch_field',
500
- 'msql_fetch_object','msql_fetch_row','msql_field_flags',
501
- 'msql_field_len','msql_field_name','msql_field_seek',
502
- 'msql_field_table','msql_field_type','msql_fieldflags',
503
- 'msql_fieldlen','msql_fieldname','msql_fieldtable','msql_fieldtype',
504
- 'msql_free_result','msql_freeresult','msql_list_dbs',
505
- 'msql_list_fields','msql_list_tables','msql_listdbs',
506
- 'msql_listfields','msql_listtables','msql_num_fields',
507
- 'msql_num_rows','msql_numfields','msql_numrows','msql_pconnect',
508
- 'msql_query','msql_regcase','msql_result','msql_select_db',
509
- 'msql_selectdb','msql_tablename','mssql_bind','mssql_close',
510
- 'mssql_connect','mssql_data_seek','mssql_execute',
511
- 'mssql_fetch_array','mssql_fetch_assoc','mssql_fetch_batch',
512
- 'mssql_fetch_field','mssql_fetch_object','mssql_fetch_row',
513
- 'mssql_field_length','mssql_field_name','mssql_field_seek',
514
- 'mssql_field_type','mssql_free_result','mssql_free_statement',
515
- 'mssql_get_last_message','mssql_guid_string','mssql_init',
516
- 'mssql_min_error_severity','mssql_min_message_severity',
517
- 'mssql_next_result','mssql_num_fields','mssql_num_rows',
518
- 'mssql_pconnect','mssql_query','mssql_result','mssql_rows_affected',
519
- 'mssql_select_db','mt_getrandmax','mt_rand','mt_srand','mysql',
520
- 'mysql_affected_rows','mysql_client_encoding','mysql_close',
521
- 'mysql_connect','mysql_createdb','mysql_create_db',
522
- 'mysql_data_seek','mysql_dbname','mysql_db_name','mysql_db_query',
523
- 'mysql_dropdb','mysql_drop_db','mysql_errno','mysql_error',
524
- 'mysql_escape_string','mysql_fetch_array','mysql_fetch_assoc',
525
- 'mysql_fetch_field','mysql_fetch_lengths','mysql_fetch_object',
526
- 'mysql_fetch_row','mysql_fieldflags','mysql_fieldlen',
527
- 'mysql_fieldname','mysql_fieldtable','mysql_fieldtype',
528
- 'mysql_field_flags','mysql_field_len','mysql_field_name',
529
- 'mysql_field_seek','mysql_field_table','mysql_field_type',
530
- 'mysql_freeresult','mysql_free_result','mysql_get_client_info',
531
- 'mysql_get_host_info','mysql_get_proto_info',
532
- 'mysql_get_server_info','mysql_info','mysql_insert_id',
533
- 'mysql_listdbs','mysql_listfields','mysql_listtables',
534
- 'mysql_list_dbs','mysql_list_fields','mysql_list_processes',
535
- 'mysql_list_tables','mysql_numfields','mysql_numrows',
536
- 'mysql_num_fields','mysql_num_rows','mysql_pconnect','mysql_ping',
537
- 'mysql_query','mysql_real_escape_string','mysql_result',
538
- 'mysql_selectdb','mysql_select_db','mysql_set_charset','mysql_stat',
539
- 'mysql_tablename','mysql_table_name','mysql_thread_id',
540
- 'mysql_unbuffered_query','mysqli_affected_rows','mysqli_autocommit',
541
- 'mysqli_bind_param','mysqli_bind_result','mysqli_change_user',
542
- 'mysqli_character_set_name','mysqli_client_encoding','mysqli_close',
543
- 'mysqli_commit','mysqli_connect','mysqli_connect_errno',
544
- 'mysqli_connect_error','mysqli_data_seek','mysqli_debug',
545
- 'mysqli_disable_reads_from_master','mysqli_disable_rpl_parse',
546
- 'mysqli_dump_debug_info','mysqli_embedded_server_end',
547
- 'mysqli_embedded_server_start','mysqli_enable_reads_from_master',
548
- 'mysqli_enable_rpl_parse','mysqli_errno','mysqli_error',
549
- 'mysqli_escape_string','mysqli_execute','mysqli_fetch',
550
- 'mysqli_fetch_array','mysqli_fetch_assoc','mysqli_fetch_field',
551
- 'mysqli_fetch_field_direct','mysqli_fetch_fields',
552
- 'mysqli_fetch_lengths','mysqli_fetch_object','mysqli_fetch_row',
553
- 'mysqli_field_count','mysqli_field_seek','mysqli_field_tell',
554
- 'mysqli_free_result','mysqli_get_charset','mysqli_get_client_info',
555
- 'mysqli_get_client_version','mysqli_get_host_info',
556
- 'mysqli_get_metadata','mysqli_get_proto_info',
557
- 'mysqli_get_server_info','mysqli_get_server_version',
558
- 'mysqli_get_warnings','mysqli_info','mysqli_init',
559
- 'mysqli_insert_id','mysqli_kill','mysqli_master_query',
560
- 'mysqli_more_results','mysqli_multi_query','mysqli_next_result',
561
- 'mysqli_num_fields','mysqli_num_rows','mysqli_options',
562
- 'mysqli_param_count','mysqli_ping','mysqli_prepare','mysqli_query',
563
- 'mysqli_real_connect','mysqli_real_escape_string',
564
- 'mysqli_real_query','mysqli_report','mysqli_rollback',
565
- 'mysqli_rpl_parse_enabled','mysqli_rpl_probe',
566
- 'mysqli_rpl_query_type','mysqli_select_db','mysqli_send_long_data',
567
- 'mysqli_send_query','mysqli_set_charset',
568
- 'mysqli_set_local_infile_default','mysqli_set_local_infile_handler',
569
- 'mysqli_set_opt','mysqli_slave_query','mysqli_sqlstate',
570
- 'mysqli_ssl_set','mysqli_stat','mysqli_stmt_affected_rows',
571
- 'mysqli_stmt_attr_get','mysqli_stmt_attr_set',
572
- 'mysqli_stmt_bind_param','mysqli_stmt_bind_result',
573
- 'mysqli_stmt_close','mysqli_stmt_data_seek','mysqli_stmt_errno',
574
- 'mysqli_stmt_error','mysqli_stmt_execute','mysqli_stmt_fetch',
575
- 'mysqli_stmt_field_count','mysqli_stmt_free_result',
576
- 'mysqli_stmt_get_warnings','mysqli_stmt_init',
577
- 'mysqli_stmt_insert_id','mysqli_stmt_num_rows',
578
- 'mysqli_stmt_param_count','mysqli_stmt_prepare','mysqli_stmt_reset',
579
- 'mysqli_stmt_result_metadata','mysqli_stmt_send_long_data',
580
- 'mysqli_stmt_sqlstate','mysqli_stmt_store_result',
581
- 'mysqli_store_result','mysqli_thread_id','mysqli_thread_safe',
582
- 'mysqli_use_result','mysqli_warning_count','natcasesort','natsort',
583
- 'new_xmldoc','next','ngettext','nl2br','nl_langinfo',
584
- 'ntuser_getdomaincontroller','ntuser_getusergroups',
585
- 'ntuser_getuserinfo','ntuser_getuserlist','number_format',
586
- 'ob_clean','ob_deflatehandler','ob_end_clean','ob_end_flush',
587
- 'ob_etaghandler','ob_flush','ob_get_clean','ob_get_contents',
588
- 'ob_get_flush','ob_get_length','ob_get_level','ob_get_status',
589
- 'ob_gzhandler','ob_iconv_handler','ob_implicit_flush',
590
- 'ob_inflatehandler','ob_list_handlers','ob_start','ob_tidyhandler',
591
- 'octdec','odbc_autocommit','odbc_binmode','odbc_close',
592
- 'odbc_close_all','odbc_columnprivileges','odbc_columns',
593
- 'odbc_commit','odbc_connect','odbc_cursor','odbc_data_source',
594
- 'odbc_do','odbc_error','odbc_errormsg','odbc_exec','odbc_execute',
595
- 'odbc_fetch_array','odbc_fetch_into','odbc_fetch_object',
596
- 'odbc_fetch_row','odbc_field_len','odbc_field_name',
597
- 'odbc_field_num','odbc_field_precision','odbc_field_scale',
598
- 'odbc_field_type','odbc_foreignkeys','odbc_free_result',
599
- 'odbc_gettypeinfo','odbc_longreadlen','odbc_next_result',
600
- 'odbc_num_fields','odbc_num_rows','odbc_pconnect','odbc_prepare',
601
- 'odbc_primarykeys','odbc_procedurecolumns','odbc_procedures',
602
- 'odbc_result','odbc_result_all','odbc_rollback','odbc_setoption',
603
- 'odbc_specialcolumns','odbc_statistics','odbc_tableprivileges',
604
- 'odbc_tables','opendir','openlog','openssl_csr_export',
605
- 'openssl_csr_export_to_file','openssl_csr_get_public_key',
606
- 'openssl_csr_get_subject','openssl_csr_new','openssl_csr_sign',
607
- 'openssl_error_string','openssl_free_key','openssl_get_privatekey',
608
- 'openssl_get_publickey','openssl_open','openssl_pkcs12_export',
609
- 'openssl_pkcs12_export_to_file','openssl_pkcs12_read',
610
- 'openssl_pkcs7_decrypt','openssl_pkcs7_encrypt',
611
- 'openssl_pkcs7_sign','openssl_pkcs7_verify','openssl_pkey_export',
612
- 'openssl_pkey_export_to_file','openssl_pkey_free',
613
- 'openssl_pkey_get_details','openssl_pkey_get_private',
614
- 'openssl_pkey_get_public','openssl_pkey_new',
615
- 'openssl_private_decrypt','openssl_private_encrypt',
616
- 'openssl_public_decrypt','openssl_public_encrypt','openssl_seal',
617
- 'openssl_sign','openssl_verify','openssl_x509_checkpurpose',
618
- 'openssl_x509_check_private_key','openssl_x509_export',
619
- 'openssl_x509_export_to_file','openssl_x509_free',
620
- 'openssl_x509_parse','openssl_x509_read','ord',
621
- 'output_add_rewrite_var','output_reset_rewrite_vars','overload',
622
- 'outputdebugstring','pack','parse_ini_file','parse_str','parse_url',
623
- 'parsekit_compile_file','parsekit_compile_string',
624
- 'parsekit_func_arginfo','parsekit_opcode_flags',
625
- 'parsekit_opcode_name','passthru','pathinfo','pclose',
626
- 'pdf_add_bookmark','pdf_add_launchlink','pdf_add_locallink',
627
- 'pdf_add_nameddest','pdf_add_note','pdf_add_pdflink',
628
- 'pdf_add_thumbnail','pdf_add_weblink','pdf_arc','pdf_arcn',
629
- 'pdf_attach_file','pdf_begin_font','pdf_begin_glyph',
630
- 'pdf_begin_page','pdf_begin_pattern','pdf_begin_template',
631
- 'pdf_circle','pdf_clip','pdf_close','pdf_close_image',
632
- 'pdf_close_pdi','pdf_close_pdi_page','pdf_closepath',
633
- 'pdf_closepath_fill_stroke','pdf_closepath_stroke','pdf_concat',
634
- 'pdf_continue_text','pdf_create_gstate','pdf_create_pvf',
635
- 'pdf_curveto','pdf_delete','pdf_delete_pvf','pdf_encoding_set_char',
636
- 'pdf_end_font','pdf_end_glyph','pdf_end_page','pdf_end_pattern',
637
- 'pdf_end_template','pdf_endpath','pdf_fill','pdf_fill_imageblock',
638
- 'pdf_fill_pdfblock','pdf_fill_stroke','pdf_fill_textblock',
639
- 'pdf_findfont','pdf_fit_image','pdf_fit_pdi_page',
640
- 'pdf_fit_textline','pdf_get_apiname','pdf_get_buffer',
641
- 'pdf_get_errmsg','pdf_get_errnum','pdf_get_parameter',
642
- 'pdf_get_pdi_parameter','pdf_get_pdi_value','pdf_get_value',
643
- 'pdf_initgraphics','pdf_lineto','pdf_load_font',
644
- 'pdf_load_iccprofile','pdf_load_image','pdf_makespotcolor',
645
- 'pdf_moveto','pdf_new','pdf_open_ccitt','pdf_open_file',
646
- 'pdf_open_image','pdf_open_image_file','pdf_open_pdi',
647
- 'pdf_open_pdi_page','pdf_place_image','pdf_place_pdi_page',
648
- 'pdf_process_pdi','pdf_rect','pdf_restore','pdf_rotate','pdf_save',
649
- 'pdf_scale','pdf_set_border_color','pdf_set_border_dash',
650
- 'pdf_set_border_style','pdf_set_gstate','pdf_set_info',
651
- 'pdf_set_parameter','pdf_set_text_pos','pdf_set_value',
652
- 'pdf_setcolor','pdf_setdash','pdf_setdashpattern','pdf_setflat',
653
- 'pdf_setfont','pdf_setlinecap','pdf_setlinejoin','pdf_setlinewidth',
654
- 'pdf_setmatrix','pdf_setmiterlimit','pdf_setpolydash','pdf_shading',
655
- 'pdf_shading_pattern','pdf_shfill','pdf_show','pdf_show_boxed',
656
- 'pdf_show_xy','pdf_skew','pdf_stringwidth','pdf_stroke',
657
- 'pdf_translate','pdo_drivers','pfsockopen','pg_affected_rows',
658
- 'pg_cancel_query','pg_clientencoding','pg_client_encoding',
659
- 'pg_close','pg_cmdtuples','pg_connect','pg_connection_busy',
660
- 'pg_connection_reset','pg_connection_status','pg_convert',
661
- 'pg_copy_from','pg_copy_to','pg_dbname','pg_delete','pg_end_copy',
662
- 'pg_errormessage','pg_escape_bytea','pg_escape_string','pg_exec',
663
- 'pg_execute','pg_fetch_all','pg_fetch_all_columns','pg_fetch_array',
664
- 'pg_fetch_assoc','pg_fetch_object','pg_fetch_result','pg_fetch_row',
665
- 'pg_fieldisnull','pg_fieldname','pg_fieldnum','pg_fieldprtlen',
666
- 'pg_fieldsize','pg_fieldtype','pg_field_is_null','pg_field_name',
667
- 'pg_field_num','pg_field_prtlen','pg_field_size','pg_field_table',
668
- 'pg_field_type','pg_field_type_oid','pg_free_result',
669
- 'pg_freeresult','pg_get_notify','pg_get_pid','pg_get_result',
670
- 'pg_getlastoid','pg_host','pg_insert','pg_last_error',
671
- 'pg_last_notice','pg_last_oid','pg_loclose','pg_locreate',
672
- 'pg_loexport','pg_loimport','pg_loopen','pg_loread','pg_loreadall',
673
- 'pg_lounlink','pg_lowrite','pg_lo_close','pg_lo_create',
674
- 'pg_lo_export','pg_lo_import','pg_lo_open','pg_lo_read',
675
- 'pg_lo_read_all','pg_lo_seek','pg_lo_tell','pg_lo_unlink',
676
- 'pg_lo_write','pg_meta_data','pg_numfields','pg_numrows',
677
- 'pg_num_fields','pg_num_rows','pg_options','pg_parameter_status',
678
- 'pg_pconnect','pg_ping','pg_port','pg_prepare','pg_put_line',
679
- 'pg_query','pg_query_params','pg_result','pg_result_error',
680
- 'pg_result_error_field','pg_result_seek','pg_result_status',
681
- 'pg_select','pg_send_execute','pg_send_prepare','pg_send_query',
682
- 'pg_send_query_params','pg_set_client_encoding',
683
- 'pg_set_error_verbosity','pg_setclientencoding','pg_trace',
684
- 'pg_transaction_status','pg_tty','pg_unescape_bytea','pg_untrace',
685
- 'pg_update','pg_version','php_egg_logo_guid','php_ini_loaded_file',
686
- 'php_ini_scanned_files','php_logo_guid','php_real_logo_guid',
687
- 'php_sapi_name','php_strip_whitespace','php_uname','phpcredits',
688
- 'phpdoc_xml_from_string','phpinfo','phpversion','pi','png2wbmp',
689
- 'pop3_close','pop3_delete_message','pop3_get_account_size',
690
- 'pop3_get_message','pop3_get_message_count',
691
- 'pop3_get_message_header','pop3_get_message_ids',
692
- 'pop3_get_message_size','pop3_get_message_sizes','pop3_open',
693
- 'pop3_undelete','popen','pos','posix_ctermid','posix_errno',
694
- 'posix_getcwd','posix_getegid','posix_geteuid','posix_getgid',
695
- 'posix_getgrgid','posix_getgrnam','posix_getgroups',
696
- 'posix_getlogin','posix_getpgid','posix_getpgrp','posix_getpid',
697
- 'posix_getppid','posix_getpwnam','posix_getpwuid','posix_getrlimit',
698
- 'posix_getsid','posix_getuid','posix_get_last_error','posix_isatty',
699
- 'posix_kill','posix_mkfifo','posix_setegid','posix_seteuid',
700
- 'posix_setgid','posix_setpgid','posix_setsid','posix_setuid',
701
- 'posix_strerror','posix_times','posix_ttyname','posix_uname','pow',
702
- 'preg_grep','preg_last_error','preg_match','preg_match_all',
703
- 'preg_quote','preg_replace','preg_replace_callback','preg_split',
704
- 'prev','print_r','printf','proc_close','proc_get_status',
705
- 'proc_open','proc_terminate','putenv','quoted_printable_decode',
706
- 'quotemeta','rad2deg','radius_acct_open','radius_add_server',
707
- 'radius_auth_open','radius_close','radius_config',
708
- 'radius_create_request','radius_cvt_addr','radius_cvt_int',
709
- 'radius_cvt_string','radius_demangle','radius_demangle_mppe_key',
710
- 'radius_get_attr','radius_get_vendor_attr','radius_put_addr',
711
- 'radius_put_attr','radius_put_int','radius_put_string',
712
- 'radius_put_vendor_addr','radius_put_vendor_attr',
713
- 'radius_put_vendor_int','radius_put_vendor_string',
714
- 'radius_request_authenticator','radius_send_request',
715
- 'radius_server_secret','radius_strerror','rand','range',
716
- 'rawurldecode','rawurlencode','read_exif_data','readdir','readfile',
717
- 'readgzfile','readlink','realpath','reg_close_key','reg_create_key',
718
- 'reg_enum_key','reg_enum_value','reg_get_value','reg_open_key',
719
- 'reg_set_value','register_shutdown_function',
720
- 'register_tick_function','rename','res_close','res_get','res_list',
721
- 'res_list_type','res_open','res_set','reset',
722
- 'restore_error_handler','restore_include_path','rewind','rewinddir',
723
- 'rmdir','round','rsort','rtrim','runkit_class_adopt',
724
- 'runkit_class_emancipate','runkit_constant_add',
725
- 'runkit_constant_redefine','runkit_constant_remove',
726
- 'runkit_default_property_add','runkit_function_add',
727
- 'runkit_function_copy','runkit_function_redefine',
728
- 'runkit_function_remove','runkit_function_rename','runkit_import',
729
- 'runkit_lint','runkit_lint_file','runkit_method_add',
730
- 'runkit_method_copy','runkit_method_redefine',
731
- 'runkit_method_remove','runkit_method_rename','runkit_object_id',
732
- 'runkit_return_value_used','runkit_sandbox_output_handler',
733
- 'runkit_superglobals','runkit_zval_inspect','scandir','sem_acquire',
734
- 'sem_get','sem_release','sem_remove','serialize',
735
- 'session_cache_expire','session_cache_limiter','session_commit',
736
- 'session_decode','session_destroy','session_encode',
737
- 'session_get_cookie_params','session_id','session_is_registered',
738
- 'session_module_name','session_name','session_regenerate_id',
739
- 'session_register','session_save_path','session_set_cookie_params',
740
- 'session_set_save_handler','session_start','session_unregister',
741
- 'session_unset','session_write_close','set_content',
742
- 'set_error_handler','set_file_buffer','set_include_path',
743
- 'set_magic_quotes_runtime','set_socket_blocking','set_time_limit',
744
- 'setcookie','setlocale','setrawcookie','settype','sha1','sha1_file',
745
- 'shell_exec','shmop_close','shmop_delete','shmop_open','shmop_read',
746
- 'shmop_size','shmop_write','shm_attach','shm_detach','shm_get_var',
747
- 'shm_put_var','shm_remove','shm_remove_var','show_source','shuffle',
748
- 'similar_text','simplexml_import_dom','simplexml_load_file',
749
- 'simplexml_load_string','sin','sinh','sizeof','sleep','smtp_close',
750
- 'smtp_cmd_data','smtp_cmd_mail','smtp_cmd_rcpt','smtp_connect',
751
- 'snmp_get_quick_print','snmp_get_valueretrieval','snmp_read_mib',
752
- 'snmp_set_quick_print','snmp_set_valueretrieval','snmp2_get',
753
- 'snmp2_getnext','snmp2_real_walk','snmp2_set','snmp2_walk',
754
- 'snmp3_get','snmp3_getnext','snmp3_real_walk','snmp3_set',
755
- 'snmp3_walk','snmpget','snmpgetnext','snmprealwalk','snmpset',
756
- 'snmpwalk','snmpwalkoid','socket_accept','socket_bind',
757
- 'socket_clear_error','socket_close','socket_connect',
758
- 'socket_create','socket_create_listen','socket_create_pair',
759
- 'socket_getopt','socket_getpeername','socket_getsockname',
760
- 'socket_get_option','socket_get_status','socket_iovec_add',
761
- 'socket_iovec_alloc','socket_iovec_delete','socket_iovec_fetch',
762
- 'socket_iovec_free','socket_iovec_set','socket_last_error',
763
- 'socket_listen','socket_read','socket_readv','socket_recv',
764
- 'socket_recvfrom','socket_recvmsg','socket_select','socket_send',
765
- 'socket_sendmsg','socket_sendto','socket_setopt','socket_set_block',
766
- 'socket_set_blocking','socket_set_nonblock','socket_set_option',
767
- 'socket_set_timeout','socket_shutdown','socket_strerror',
768
- 'socket_write','socket_writev','sort','soundex','spl_autoload',
769
- 'spl_autoload_call','spl_autoload_extensions',
770
- 'spl_autoload_functions','spl_autoload_register',
771
- 'spl_autoload_unregister','spl_classes','spl_object_hash','split',
772
- 'spliti','sprintf','sql_regcase','sqlite_array_query',
773
- 'sqlite_busy_timeout','sqlite_changes','sqlite_close',
774
- 'sqlite_column','sqlite_create_aggregate','sqlite_create_function',
775
- 'sqlite_current','sqlite_error_string','sqlite_escape_string',
776
- 'sqlite_exec','sqlite_factory','sqlite_fetch_all',
777
- 'sqlite_fetch_array','sqlite_fetch_column_types',
778
- 'sqlite_fetch_object','sqlite_fetch_single','sqlite_fetch_string',
779
- 'sqlite_field_name','sqlite_has_more','sqlite_has_prev',
780
- 'sqlite_last_error','sqlite_last_insert_rowid','sqlite_libencoding',
781
- 'sqlite_libversion','sqlite_next','sqlite_num_fields',
782
- 'sqlite_num_rows','sqlite_open','sqlite_popen','sqlite_prev',
783
- 'sqlite_query','sqlite_rewind','sqlite_seek','sqlite_single_query',
784
- 'sqlite_udf_decode_binary','sqlite_udf_encode_binary',
785
- 'sqlite_unbuffered_query','sqlite_valid','sqrt','srand','sscanf',
786
- 'ssh2_auth_hostbased_file','ssh2_auth_none','ssh2_auth_password',
787
- 'ssh2_auth_pubkey_file','ssh2_connect','ssh2_exec',
788
- 'ssh2_fetch_stream','ssh2_fingerprint','ssh2_forward_accept',
789
- 'ssh2_forward_listen','ssh2_methods_negotiated','ssh2_poll',
790
- 'ssh2_publickey_add','ssh2_publickey_init','ssh2_publickey_list',
791
- 'ssh2_publickey_remove','ssh2_scp_recv','ssh2_scp_send','ssh2_sftp',
792
- 'ssh2_sftp_lstat','ssh2_sftp_mkdir','ssh2_sftp_readlink',
793
- 'ssh2_sftp_realpath','ssh2_sftp_rename','ssh2_sftp_rmdir',
794
- 'ssh2_sftp_stat','ssh2_sftp_symlink','ssh2_sftp_unlink',
795
- 'ssh2_shell','ssh2_tunnel','stat','stats_absolute_deviation',
796
- 'stats_cdf_beta','stats_cdf_binomial','stats_cdf_cauchy',
797
- 'stats_cdf_chisquare','stats_cdf_exponential','stats_cdf_f',
798
- 'stats_cdf_gamma','stats_cdf_laplace','stats_cdf_logistic',
799
- 'stats_cdf_negative_binomial','stats_cdf_noncentral_chisquare',
800
- 'stats_cdf_noncentral_f','stats_cdf_noncentral_t',
801
- 'stats_cdf_normal','stats_cdf_poisson','stats_cdf_t',
802
- 'stats_cdf_uniform','stats_cdf_weibull','stats_covariance',
803
- 'stats_dens_beta','stats_dens_cauchy','stats_dens_chisquare',
804
- 'stats_dens_exponential','stats_dens_f','stats_dens_gamma',
805
- 'stats_dens_laplace','stats_dens_logistic','stats_dens_normal',
806
- 'stats_dens_pmf_binomial','stats_dens_pmf_hypergeometric',
807
- 'stats_dens_pmf_negative_binomial','stats_dens_pmf_poisson',
808
- 'stats_dens_t','stats_dens_uniform','stats_dens_weibull',
809
- 'stats_harmonic_mean','stats_kurtosis','stats_rand_gen_beta',
810
- 'stats_rand_gen_chisquare','stats_rand_gen_exponential',
811
- 'stats_rand_gen_f','stats_rand_gen_funiform','stats_rand_gen_gamma',
812
- 'stats_rand_gen_ipoisson','stats_rand_gen_iuniform',
813
- 'stats_rand_gen_noncenral_f','stats_rand_gen_noncentral_chisquare',
814
- 'stats_rand_gen_noncentral_t','stats_rand_gen_normal',
815
- 'stats_rand_gen_t','stats_rand_getsd','stats_rand_ibinomial',
816
- 'stats_rand_ibinomial_negative','stats_rand_ignlgi',
817
- 'stats_rand_phrase_to_seeds','stats_rand_ranf','stats_rand_setall',
818
- 'stats_skew','stats_standard_deviation','stats_stat_binomial_coef',
819
- 'stats_stat_correlation','stats_stat_factorial',
820
- 'stats_stat_independent_t','stats_stat_innerproduct',
821
- 'stats_stat_paired_t','stats_stat_percentile','stats_stat_powersum',
822
- 'stats_variance','strcasecmp','strchr','strcmp','strcoll','strcspn',
823
- 'stream_bucket_append','stream_bucket_make_writeable',
824
- 'stream_bucket_new','stream_bucket_prepend','stream_context_create',
825
- 'stream_context_get_default','stream_context_get_options',
826
- 'stream_context_set_default','stream_context_set_option',
827
- 'stream_context_set_params','stream_copy_to_stream',
828
- 'stream_encoding','stream_filter_append','stream_filter_prepend',
829
- 'stream_filter_register','stream_filter_remove',
830
- 'stream_get_contents','stream_get_filters','stream_get_line',
831
- 'stream_get_meta_data','stream_get_transports',
832
- 'stream_get_wrappers','stream_is_local',
833
- 'stream_notification_callback','stream_register_wrapper',
834
- 'stream_resolve_include_path','stream_select','stream_set_blocking',
835
- 'stream_set_timeout','stream_set_write_buffer',
836
- 'stream_socket_accept','stream_socket_client',
837
- 'stream_socket_enable_crypto','stream_socket_get_name',
838
- 'stream_socket_pair','stream_socket_recvfrom',
839
- 'stream_socket_sendto','stream_socket_server',
840
- 'stream_socket_shutdown','stream_supports_lock',
841
- 'stream_wrapper_register','stream_wrapper_restore',
842
- 'stream_wrapper_unregister','strftime','stripcslashes','stripos',
843
- 'stripslashes','strip_tags','stristr','strlen','strnatcasecmp',
844
- 'strnatcmp','strpbrk','strncasecmp','strncmp','strpos','strrchr',
845
- 'strrev','strripos','strrpos','strspn','strstr','strtok',
846
- 'strtolower','strtotime','strtoupper','strtr','strval',
847
- 'str_ireplace','str_pad','str_repeat','str_replace','str_rot13',
848
- 'str_split','str_shuffle','str_word_count','substr',
849
- 'substr_compare','substr_count','substr_replace','svn_add',
850
- 'svn_auth_get_parameter','svn_auth_set_parameter','svn_cat',
851
- 'svn_checkout','svn_cleanup','svn_client_version','svn_commit',
852
- 'svn_diff','svn_export','svn_fs_abort_txn','svn_fs_apply_text',
853
- 'svn_fs_begin_txn2','svn_fs_change_node_prop','svn_fs_check_path',
854
- 'svn_fs_contents_changed','svn_fs_copy','svn_fs_delete',
855
- 'svn_fs_dir_entries','svn_fs_file_contents','svn_fs_file_length',
856
- 'svn_fs_is_dir','svn_fs_is_file','svn_fs_make_dir',
857
- 'svn_fs_make_file','svn_fs_node_created_rev','svn_fs_node_prop',
858
- 'svn_fs_props_changed','svn_fs_revision_prop',
859
- 'svn_fs_revision_root','svn_fs_txn_root','svn_fs_youngest_rev',
860
- 'svn_import','svn_info','svn_log','svn_ls','svn_repos_create',
861
- 'svn_repos_fs','svn_repos_fs_begin_txn_for_commit',
862
- 'svn_repos_fs_commit_txn','svn_repos_hotcopy','svn_repos_open',
863
- 'svn_repos_recover','svn_status','svn_update','symlink',
864
- 'sys_get_temp_dir','syslog','system','tan','tanh','tempnam',
865
- 'textdomain','thread_get','thread_include','thread_lock',
866
- 'thread_lock_try','thread_mutex_destroy','thread_mutex_init',
867
- 'thread_set','thread_start','thread_unlock','tidy_access_count',
868
- 'tidy_clean_repair','tidy_config_count','tidy_diagnose',
869
- 'tidy_error_count','tidy_get_body','tidy_get_config',
870
- 'tidy_get_error_buffer','tidy_get_head','tidy_get_html',
871
- 'tidy_get_html_ver','tidy_get_output','tidy_get_release',
872
- 'tidy_get_root','tidy_get_status','tidy_getopt','tidy_is_xhtml',
873
- 'tidy_is_xml','tidy_parse_file','tidy_parse_string',
874
- 'tidy_repair_file','tidy_repair_string','tidy_warning_count','time',
875
- 'timezone_abbreviations_list','timezone_identifiers_list',
876
- 'timezone_name_from_abbr','timezone_name_get','timezone_offset_get',
877
- 'timezone_open','timezone_transitions_get','tmpfile',
878
- 'token_get_all','token_name','touch','trigger_error',
879
- 'transliterate','transliterate_filters_get','trim','uasort',
880
- 'ucfirst','ucwords','uksort','umask','uniqid','unixtojd','unlink',
881
- 'unpack','unregister_tick_function','unserialize','unset',
882
- 'urldecode','urlencode','user_error','use_soap_error_handler',
883
- 'usleep','usort','utf8_decode','utf8_encode','var_dump',
884
- 'var_export','variant_abs','variant_add','variant_and',
885
- 'variant_cast','variant_cat','variant_cmp',
886
- 'variant_date_from_timestamp','variant_date_to_timestamp',
887
- 'variant_div','variant_eqv','variant_fix','variant_get_type',
888
- 'variant_idiv','variant_imp','variant_int','variant_mod',
889
- 'variant_mul','variant_neg','variant_not','variant_or',
890
- 'variant_pow','variant_round','variant_set','variant_set_type',
891
- 'variant_sub','variant_xor','version_compare','virtual','vfprintf',
892
- 'vprintf','vsprintf','wddx_add_vars','wddx_deserialize',
893
- 'wddx_packet_end','wddx_packet_start','wddx_serialize_value',
894
- 'wddx_serialize_vars','win_beep','win_browse_file',
895
- 'win_browse_folder','win_create_link','win_message_box',
896
- 'win_play_wav','win_shell_execute','win32_create_service',
897
- 'win32_delete_service','win32_get_last_control_message',
898
- 'win32_ps_list_procs','win32_ps_stat_mem','win32_ps_stat_proc',
899
- 'win32_query_service_status','win32_scheduler_delete_task',
900
- 'win32_scheduler_enum_tasks','win32_scheduler_get_task_info',
901
- 'win32_scheduler_run','win32_scheduler_set_task_info',
902
- 'win32_set_service_status','win32_start_service',
903
- 'win32_start_service_ctrl_dispatcher','win32_stop_service',
904
- 'wordwrap','xml_error_string','xml_get_current_byte_index',
905
- 'xml_get_current_column_number','xml_get_current_line_number',
906
- 'xml_get_error_code','xml_parse','xml_parser_create',
907
- 'xml_parser_create_ns','xml_parser_free','xml_parser_get_option',
908
- 'xml_parser_set_option','xml_parse_into_struct',
909
- 'xml_set_character_data_handler','xml_set_default_handler',
910
- 'xml_set_element_handler','xml_set_end_namespace_decl_handler',
911
- 'xml_set_external_entity_ref_handler',
912
- 'xml_set_notation_decl_handler','xml_set_object',
913
- 'xml_set_processing_instruction_handler',
914
- 'xml_set_start_namespace_decl_handler',
915
- 'xml_set_unparsed_entity_decl_handler','xmldoc','xmldocfile',
916
- 'xmlrpc_decode','xmlrpc_decode_request','xmlrpc_encode',
917
- 'xmlrpc_encode_request','xmlrpc_get_type','xmlrpc_is_fault',
918
- 'xmlrpc_parse_method_descriptions',
919
- 'xmlrpc_server_add_introspection_data','xmlrpc_server_call_method',
920
- 'xmlrpc_server_create','xmlrpc_server_destroy',
921
- 'xmlrpc_server_register_introspection_callback',
922
- 'xmlrpc_server_register_method','xmlrpc_set_type','xmltree',
923
- 'xmlwriter_end_attribute','xmlwriter_end_cdata',
924
- 'xmlwriter_end_comment','xmlwriter_end_document',
925
- 'xmlwriter_end_dtd','xmlwriter_end_dtd_attlist',
926
- 'xmlwriter_end_dtd_element','xmlwriter_end_dtd_entity',
927
- 'xmlwriter_end_element','xmlwriter_end_pi','xmlwriter_flush',
928
- 'xmlwriter_full_end_element','xmlwriter_open_memory',
929
- 'xmlwriter_open_uri','xmlwriter_output_memory',
930
- 'xmlwriter_set_indent','xmlwriter_set_indent_string',
931
- 'xmlwriter_start_attribute','xmlwriter_start_attribute_ns',
932
- 'xmlwriter_start_cdata','xmlwriter_start_comment',
933
- 'xmlwriter_start_document','xmlwriter_start_dtd',
934
- 'xmlwriter_start_dtd_attlist','xmlwriter_start_dtd_element',
935
- 'xmlwriter_start_dtd_entity','xmlwriter_start_element',
936
- 'xmlwriter_start_element_ns','xmlwriter_start_pi','xmlwriter_text',
937
- 'xmlwriter_write_attribute','xmlwriter_write_attribute_ns',
938
- 'xmlwriter_write_cdata','xmlwriter_write_comment',
939
- 'xmlwriter_write_dtd','xmlwriter_write_dtd_attlist',
940
- 'xmlwriter_write_dtd_element','xmlwriter_write_dtd_entity',
941
- 'xmlwriter_write_element','xmlwriter_write_element_ns',
942
- 'xmlwriter_write_pi','xmlwriter_write_raw','xpath_eval',
943
- 'xpath_eval_expression','xpath_new_context','xpath_register_ns',
944
- 'xpath_register_ns_auto','xptr_eval','xptr_new_context','yp_all',
945
- 'yp_cat','yp_errno','yp_err_string','yp_first',
946
- 'yp_get_default_domain','yp_master','yp_match','yp_next','yp_order',
947
- 'zend_current_obfuscation_level','zend_get_cfg_var','zend_get_id',
948
- 'zend_loader_current_file','zend_loader_enabled',
949
- 'zend_loader_file_encoded','zend_loader_file_licensed',
950
- 'zend_loader_install_license','zend_loader_version',
951
- 'zend_logo_guid','zend_match_hostmasks','zend_obfuscate_class_name',
952
- 'zend_obfuscate_function_name','zend_optimizer_version',
953
- 'zend_runtime_obfuscate','zend_version','zip_close',
954
- 'zip_entry_close','zip_entry_compressedsize',
955
- 'zip_entry_compressionmethod','zip_entry_filesize','zip_entry_name',
956
- 'zip_entry_open','zip_entry_read','zip_open','zip_read',
957
- 'zlib_get_coding_type'
958
- ),
959
- 4 => array(
960
- 'DEFAULT_INCLUDE_PATH', 'DIRECTORY_SEPARATOR', 'E_ALL',
961
- 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_CORE_ERROR',
962
- 'E_CORE_WARNING', 'E_ERROR', 'E_NOTICE', 'E_PARSE', 'E_STRICT',
963
- 'E_USER_ERROR', 'E_USER_NOTICE', 'E_USER_WARNING', 'E_WARNING',
964
- 'ENT_COMPAT','ENT_QUOTES','ENT_NOQUOTES',
965
- 'false', 'null', 'PEAR_EXTENSION_DIR', 'PEAR_INSTALL_DIR',
966
- 'PHP_BINDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_DATADIR',
967
- 'PHP_EXTENSION_DIR', 'PHP_LIBDIR',
968
- 'PHP_LOCALSTATEDIR', 'PHP_OS',
969
- 'PHP_OUTPUT_HANDLER_CONT', 'PHP_OUTPUT_HANDLER_END',
970
- 'PHP_OUTPUT_HANDLER_START', 'PHP_SYSCONFDIR',
971
- 'PHP_VERSION', 'true', '__CLASS__', '__FILE__', '__FUNCTION__',
972
- '__LINE__', '__METHOD__'
973
- )
974
- ),
975
- 'SYMBOLS' => array(
976
- 1 => array(
977
- '<'.'%', '<'.'%=', '%'.'>', '<'.'?', '<'.'?=', '?'.'>'
978
- ),
979
- 0 => array(
980
- '(', ')', '[', ']', '{', '}',
981
- '!', '@', '%', '&', '|', '/',
982
- '<', '>',
983
- '=', '-', '+', '*',
984
- '.', ':', ',', ';'
985
- )
986
- ),
987
- 'CASE_SENSITIVE' => array(
988
- GESHI_COMMENTS => false,
989
- 1 => false,
990
- 2 => false,
991
- 3 => false,
992
- 4 => false
993
- ),
994
- 'STYLES' => array(
995
- 'KEYWORDS' => array(
996
- 1 => 'color: #b1b100;',
997
- 2 => 'color: #000000; font-weight: bold;',
998
- 3 => 'color: #990000;',
999
- 4 => 'color: #009900; font-weight: bold;'
1000
- ),
1001
- 'COMMENTS' => array(
1002
- 1 => 'color: #666666; font-style: italic;',
1003
- 2 => 'color: #666666; font-style: italic;',
1004
- 3 => 'color: #0000cc; font-style: italic;',
1005
- 4 => 'color: #009933; font-style: italic;',
1006
- 'MULTI' => 'color: #666666; font-style: italic;'
1007
- ),
1008
- 'ESCAPE_CHAR' => array(
1009
- 0 => 'color: #000099; font-weight: bold;',
1010
- 1 => 'color: #000099; font-weight: bold;',
1011
- 2 => 'color: #660099; font-weight: bold;',
1012
- 3 => 'color: #660099; font-weight: bold;',
1013
- 4 => 'color: #006699; font-weight: bold;',
1014
- 5 => 'color: #006699; font-weight: bold; font-style: italic;',
1015
- 6 => 'color: #009933; font-weight: bold;',
1016
- 'HARD' => 'color: #000099; font-weight: bold;'
1017
- ),
1018
- 'BRACKETS' => array(
1019
- 0 => 'color: #009900;'
1020
- ),
1021
- 'STRINGS' => array(
1022
- 0 => 'color: #0000ff;',
1023
- 'HARD' => 'color: #0000ff;'
1024
- ),
1025
- 'NUMBERS' => array(
1026
- 0 => 'color: #cc66cc;',
1027
- GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
1028
- GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
1029
- GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
1030
- ),
1031
- 'METHODS' => array(
1032
- 1 => 'color: #004000;',
1033
- 2 => 'color: #004000;'
1034
- ),
1035
- 'SYMBOLS' => array(
1036
- 0 => 'color: #339933;',
1037
- 1 => 'color: #000000; font-weight: bold;'
1038
- ),
1039
- 'REGEXPS' => array(
1040
- 0 => 'color: #000088;'
1041
- ),
1042
- 'SCRIPT' => array(
1043
- 0 => '',
1044
- 1 => '',
1045
- 2 => '',
1046
- 3 => '',
1047
- 4 => '',
1048
- 5 => ''
1049
- )
1050
- ),
1051
- 'URLS' => array(
1052
- 1 => '',
1053
- 2 => '',
1054
- 3 => 'http://www.php.net/{FNAMEL}',
1055
- 4 => ''
1056
- ),
1057
- 'OOLANG' => true,
1058
- 'OBJECT_SPLITTERS' => array(
1059
- 1 => '-&gt;',
1060
- 2 => '::'
1061
- ),
1062
- 'REGEXPS' => array(
1063
- //Variables
1064
- 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*"
1065
- ),
1066
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
1067
- 'SCRIPT_DELIMITERS' => array(
1068
- 0 => array(
1069
- '<'.'?php' => '?'.'>'
1070
- ),
1071
- 1 => array(
1072
- '<'.'?' => '?'.'>'
1073
- ),
1074
- 2 => array(
1075
- '<'.'%' => '%'.'>'
1076
- ),
1077
- 3 => array(
1078
- '<script language="php">' => '</script>'
1079
- ),
1080
- 4 => "/(?P<start><\\?(?>php\b)?)(?:".
1081
- "(?>[^\"'?\\/<]+)|".
1082
- "\\?(?!>)|".
1083
- "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|".
1084
- "(?>\"(?>[^\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
1085
- "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
1086
- "\\/\\/(?>.*?$)|".
1087
- "\\/(?=[^*\\/])|".
1088
- "<(?!<<)|".
1089
- "<<<(?P<phpdoc>\w+)\s.*?\s\k<phpdoc>".
1090
- ")*(?P<end>\\?>|\Z)/sm",
1091
- 5 => "/(?P<start><%)(?:".
1092
- "(?>[^\"'%\\/<]+)|".
1093
- "%(?!>)|".
1094
- "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|".
1095
- "(?>\"(?>[^\\\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
1096
- "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
1097
- "\\/\\/(?>.*?$)|".
1098
- "\\/(?=[^*\\/])|".
1099
- "<(?!<<)|".
1100
- "<<<(?P<phpdoc>\w+)\s.*?\s\k<phpdoc>".
1101
- ")*(?P<end>%>)/sm",
1102
- ),
1103
- 'HIGHLIGHT_STRICT_BLOCK' => array(
1104
- 0 => true,
1105
- 1 => true,
1106
- 2 => true,
1107
- 3 => true,
1108
- 4 => true,
1109
- 5 => true
1110
- ),
1111
- 'TAB_WIDTH' => 4
1112
- );
1113
-
1114
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/python.php DELETED
@@ -1,244 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * python.php
4
- * ----------
5
- * Author: Roberto Rossi (rsoftware@altervista.org)
6
- * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2004/08/30
9
- *
10
- * Python language file for GeSHi.
11
- *
12
- * CHANGES
13
- * -------
14
- * 2008/12/18
15
- * - Added missing functions and keywords. Also added two new Python 3.0 types. SF#2441839
16
- * 2005/05/26
17
- * - Modifications by Tim (tim@skreak.com): added more keyword categories, tweaked colors
18
- * 2004/11/27 (1.0.1)
19
- * - Added support for multiple object splitters
20
- * 2004/08/30 (1.0.0)
21
- * - First Release
22
- *
23
- * TODO (updated 2004/11/27)
24
- * -------------------------
25
- *
26
- *************************************************************************************
27
- *
28
- * This file is part of GeSHi.
29
- *
30
- * GeSHi is free software; you can redistribute it and/or modify
31
- * it under the terms of the GNU General Public License as published by
32
- * the Free Software Foundation; either version 2 of the License, or
33
- * (at your option) any later version.
34
- *
35
- * GeSHi is distributed in the hope that it will be useful,
36
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
37
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38
- * GNU General Public License for more details.
39
- *
40
- * You should have received a copy of the GNU General Public License
41
- * along with GeSHi; if not, write to the Free Software
42
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
43
- *
44
- ************************************************************************************/
45
-
46
- $language_data = array (
47
- 'LANG_NAME' => 'Python',
48
- 'COMMENT_SINGLE' => array(1 => '#'),
49
- 'COMMENT_MULTI' => array(),
50
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
51
- //Longest quotemarks ALWAYS first
52
- 'QUOTEMARKS' => array('"""', "'''", '"', "'"),
53
- 'ESCAPE_CHAR' => '\\',
54
- 'NUMBERS' =>
55
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_BIN_PREFIX_0B |
56
- GESHI_NUMBER_OCT_PREFIX_0O | GESHI_NUMBER_HEX_PREFIX |
57
- GESHI_NUMBER_FLT_NONSCI | GESHI_NUMBER_FLT_NONSCI_F |
58
- GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO,
59
- 'KEYWORDS' => array(
60
-
61
- /*
62
- ** Set 1: reserved words
63
- ** http://python.org/doc/current/ref/keywords.html
64
- */
65
- 1 => array(
66
- 'and', 'del', 'for', 'is', 'raise', 'assert', 'elif', 'from', 'lambda', 'return', 'break',
67
- 'else', 'global', 'not', 'try', 'class', 'except', 'if', 'or', 'while', 'continue', 'exec',
68
- 'import', 'pass', 'yield', 'def', 'finally', 'in', 'print', 'with', 'as', 'nonlocal'
69
- ),
70
-
71
- /*
72
- ** Set 2: builtins
73
- ** http://python.org/doc/current/lib/built-in-funcs.html
74
- */
75
- 2 => array(
76
- '__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp',
77
- 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile',
78
- 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',
79
- 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',
80
- 'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
81
- 'raw_input', 'reduce', 'reload', 'reversed', 'round', 'set', 'setattr', 'slice',
82
- 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode',
83
- 'vars', 'xrange', 'zip',
84
- // Built-in constants: http://python.org/doc/current/lib/node35.html
85
- 'False', 'True', 'None', 'NotImplemented', 'Ellipsis',
86
- // Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html
87
- 'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',
88
- 'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',
89
- 'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',
90
- 'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',
91
- 'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',
92
- 'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',
93
- 'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',
94
- 'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',
95
- 'RuntimeWarning', 'FutureWarning',
96
- // self: this is a common python convention (but not a reserved word)
97
- 'self',
98
- // other
99
- 'any', 'all'
100
- ),
101
-
102
- /*
103
- ** Set 3: standard library
104
- ** http://python.org/doc/current/lib/modindex.html
105
- */
106
- 3 => array(
107
- '__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',
108
- 'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',
109
- 'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',
110
- 'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',
111
- 'collections', 'colorsys', 'commands', 'compileall', 'compiler',
112
- 'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',
113
- 'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',
114
- 'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',
115
- 'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',
116
- 'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',
117
- 'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',
118
- 'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',
119
- 'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',
120
- 'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',
121
- 'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',
122
- 'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',
123
- 'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',
124
- 'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',
125
- 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',
126
- 're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter',
127
- 'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',
128
- 'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',
129
- 'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',
130
- 'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',
131
- 'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',
132
- 'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',
133
- 'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',
134
- 'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',
135
- 'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',
136
- 'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib',
137
- // Python 3.0
138
- 'bytes', 'bytearray'
139
- ),
140
-
141
- /*
142
- ** Set 4: special methods
143
- ** http://python.org/doc/current/ref/specialnames.html
144
- */
145
- 4 => array(
146
- /*
147
- // Iterator types: http://python.org/doc/current/lib/typeiter.html
148
- '__iter__', 'next',
149
- // String types: http://python.org/doc/current/lib/string-methods.html
150
- 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
151
- 'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle',
152
- 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
153
- 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
154
- 'translate', 'upper', 'zfill',
155
- */
156
- // Basic customization: http://python.org/doc/current/ref/customization.html
157
- '__new__', '__init__', '__del__', '__repr__', '__str__',
158
- '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',
159
- '__hash__', '__nonzero__', '__unicode__', '__dict__',
160
- // Attribute access: http://python.org/doc/current/ref/attribute-access.html
161
- '__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',
162
- '__delete__', '__slots__',
163
- // Class creation, callable objects
164
- '__metaclass__', '__call__',
165
- // Container types: http://python.org/doc/current/ref/sequence-types.html
166
- '__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',
167
- '__getslice__', '__setslice__', '__delslice__',
168
- // Numeric types: http://python.org/doc/current/ref/numeric-types.html
169
- '__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',
170
- '__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',
171
- '__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',
172
- '__long__','__lshift__',
173
- '__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',
174
- '__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',
175
- '__rshift__','__rsub__','__rmul__','__rand__','__rxor__','__ror__',
176
- '__sub__','__xor__'
177
- )
178
- ),
179
- 'SYMBOLS' => array(
180
- '<', '>', '=', '!', '<=', '>=', //·comparison·operators
181
- '~', '@', //·unary·operators
182
- ';', ',' //·statement·separator
183
- ),
184
- 'CASE_SENSITIVE' => array(
185
- GESHI_COMMENTS => false,
186
- 1 => true,
187
- 2 => true,
188
- 3 => true,
189
- 4 => true
190
- ),
191
- 'STYLES' => array(
192
- 'KEYWORDS' => array(
193
- 1 => 'color: #ff7700;font-weight:bold;', // Reserved
194
- 2 => 'color: #008000;', // Built-ins + self
195
- 3 => 'color: #dc143c;', // Standard lib
196
- 4 => 'color: #0000cd;' // Special methods
197
- ),
198
- 'COMMENTS' => array(
199
- 1 => 'color: #808080; font-style: italic;',
200
- 'MULTI' => 'color: #808080; font-style: italic;'
201
- ),
202
- 'ESCAPE_CHAR' => array(
203
- 0 => 'color: #000099; font-weight: bold;'
204
- ),
205
- 'BRACKETS' => array(
206
- 0 => 'color: black;'
207
- ),
208
- 'STRINGS' => array(
209
- 0 => 'color: #483d8b;'
210
- ),
211
- 'NUMBERS' => array(
212
- 0 => 'color: #ff4500;'
213
- ),
214
- 'METHODS' => array(
215
- 1 => 'color: black;'
216
- ),
217
- 'SYMBOLS' => array(
218
- 0 => 'color: #66cc66;'
219
- ),
220
- 'REGEXPS' => array(
221
- ),
222
- 'SCRIPT' => array(
223
- )
224
- ),
225
- 'URLS' => array(
226
- 1 => '',
227
- 2 => '',
228
- 3 => '',
229
- 4 => ''
230
- ),
231
- 'OOLANG' => true,
232
- 'OBJECT_SPLITTERS' => array(
233
- 1 => '.'
234
- ),
235
- 'REGEXPS' => array(
236
- ),
237
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
238
- 'SCRIPT_DELIMITERS' => array(
239
- ),
240
- 'HIGHLIGHT_STRICT_BLOCK' => array(
241
- )
242
- );
243
-
244
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/ruby.php DELETED
@@ -1,231 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * ruby.php
4
- * --------
5
- * Author: Moises Deniz
6
- * Copyright: (c) 2007 Moises Deniz
7
- * Release Version: 1.0.8.10
8
- * Date Started: 2007/03/21
9
- *
10
- * Ruby language file for GeSHi.
11
- *
12
- * CHANGES
13
- * -------
14
- * 2008/05/23 (1.0.7.22)
15
- * - Added description of extra language features (SF#1970248)
16
- * 2007/03/21 (1.0.7.19)
17
- * - Initial release
18
- *
19
- *************************************************************************************
20
- *
21
- * This file is part of GeSHi.
22
- *
23
- * GeSHi is free software; you can redistribute it and/or modify
24
- * it under the terms of the GNU General Public License as published by
25
- * the Free Software Foundation; either version 2 of the License, or
26
- * (at your option) any later version.
27
- *
28
- * GeSHi is distributed in the hope that it will be useful,
29
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
30
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31
- * GNU General Public License for more details.
32
- *
33
- * You should have received a copy of the GNU General Public License
34
- * along with GeSHi; if not, write to the Free Software
35
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
36
- *
37
- ************************************************************************************/
38
-
39
- $language_data = array (
40
- 'LANG_NAME' => 'Ruby',
41
- 'COMMENT_SINGLE' => array(1 => "#"),
42
- 'COMMENT_MULTI' => array("=begin" => "=end"),
43
- 'COMMENT_REGEXP' => array(
44
- //Heredoc
45
- 4 => '/<<\s*?(\w+)\\n.*?\\n\\1(?![a-zA-Z0-9])/si',
46
- ),
47
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
48
- 'QUOTEMARKS' => array('"', '`','\''),
49
- 'ESCAPE_CHAR' => '\\',
50
- 'KEYWORDS' => array(
51
- 1 => array(
52
- 'alias', 'and', 'begin', 'break', 'case', 'class',
53
- 'def', 'defined', 'do', 'else', 'elsif', 'end',
54
- 'ensure', 'for', 'if', 'in', 'module', 'while',
55
- 'next', 'not', 'or', 'redo', 'rescue', 'yield',
56
- 'retry', 'super', 'then', 'undef', 'unless',
57
- 'until', 'when', 'include'
58
- ),
59
- 2 => array(
60
- '__FILE__', '__LINE__', 'false', 'nil', 'self', 'true',
61
- 'return'
62
- ),
63
- 3 => array(
64
- 'Array', 'Float', 'Integer', 'String', 'at_exit',
65
- 'autoload', 'binding', 'caller', 'catch', 'chop', 'chop!',
66
- 'chomp', 'chomp!', 'eval', 'exec', 'exit', 'exit!', 'fail',
67
- 'fork', 'format', 'gets', 'global_variables', 'gsub', 'gsub!',
68
- 'iterator?', 'lambda', 'load', 'local_variables', 'loop',
69
- 'open', 'p', 'print', 'printf', 'proc', 'putc', 'puts',
70
- 'raise', 'rand', 'readline', 'readlines', 'require', 'select',
71
- 'sleep', 'split', 'sprintf', 'srand', 'sub', 'sub!', 'syscall',
72
- 'system', 'trace_var', 'trap', 'untrace_var'
73
- ),
74
- 4 => array(
75
- 'Abbrev', 'ArgumentError', 'Base64', 'Benchmark',
76
- 'Benchmark::Tms', 'Bignum', 'Binding', 'CGI', 'CGI::Cookie',
77
- 'CGI::HtmlExtension', 'CGI::QueryExtension',
78
- 'CGI::Session', 'CGI::Session::FileStore',
79
- 'CGI::Session::MemoryStore', 'Class', 'Comparable', 'Complex',
80
- 'ConditionVariable', 'Continuation', 'Data',
81
- 'Date', 'DateTime', 'Delegator', 'Dir', 'EOFError', 'ERB',
82
- 'ERB::Util', 'Enumerable', 'Enumerable::Enumerator', 'Errno',
83
- 'Exception', 'FalseClass', 'File',
84
- 'File::Constants', 'File::Stat', 'FileTest', 'FileUtils',
85
- 'FileUtils::DryRun', 'FileUtils::NoWrite',
86
- 'FileUtils::StreamUtils_', 'FileUtils::Verbose', 'Find',
87
- 'Fixnum', 'FloatDomainError', 'Forwardable', 'GC', 'Generator',
88
- 'Hash', 'IO', 'IOError', 'Iconv', 'Iconv::BrokenLibrary',
89
- 'Iconv::Failure', 'Iconv::IllegalSequence',
90
- 'Iconv::InvalidCharacter', 'Iconv::InvalidEncoding',
91
- 'Iconv::OutOfRange', 'IndexError', 'Interrupt', 'Kernel',
92
- 'LoadError', 'LocalJumpError', 'Logger', 'Logger::Application',
93
- 'Logger::Error', 'Logger::Formatter', 'Logger::LogDevice',
94
- 'Logger::LogDevice::LogDeviceMutex', 'Logger::Severity',
95
- 'Logger::ShiftingError', 'Marshal', 'MatchData',
96
- 'Math', 'Matrix', 'Method', 'Module', 'Mutex', 'NameError',
97
- 'NameError::message', 'NilClass', 'NoMemoryError',
98
- 'NoMethodError', 'NotImplementedError', 'Numeric', 'Object',
99
- 'ObjectSpace', 'Observable', 'PStore', 'PStore::Error',
100
- 'Pathname', 'Precision', 'Proc', 'Process', 'Process::GID',
101
- 'Process::Status', 'Process::Sys', 'Process::UID', 'Queue',
102
- 'Range', 'RangeError', 'Rational', 'Regexp', 'RegexpError',
103
- 'RuntimeError', 'ScriptError', 'SecurityError', 'Set',
104
- 'Shellwords', 'Signal', 'SignalException', 'SimpleDelegator',
105
- 'SingleForwardable', 'Singleton', 'SingletonClassMethods',
106
- 'SizedQueue', 'SortedSet', 'StandardError', 'StringIO',
107
- 'StringScanner', 'StringScanner::Error', 'Struct', 'Symbol',
108
- 'SyncEnumerator', 'SyntaxError', 'SystemCallError',
109
- 'SystemExit', 'SystemStackError', 'Tempfile',
110
- 'Test::Unit::TestCase', 'Test::Unit', 'Test', 'Thread',
111
- 'ThreadError', 'ThreadGroup',
112
- 'ThreadsWait', 'Time', 'TrueClass', 'TypeError', 'URI',
113
- 'URI::BadURIError', 'URI::Error', 'URI::Escape', 'URI::FTP',
114
- 'URI::Generic', 'URI::HTTP', 'URI::HTTPS',
115
- 'URI::InvalidComponentError', 'URI::InvalidURIError',
116
- 'URI::LDAP', 'URI::MailTo', 'URI::REGEXP',
117
- 'URI::REGEXP::PATTERN', 'UnboundMethod', 'Vector', 'YAML',
118
- 'ZeroDivisionError', 'Zlib',
119
- 'Zlib::BufError', 'Zlib::DataError', 'Zlib::Deflate',
120
- 'Zlib::Error', 'Zlib::GzipFile', 'Zlib::GzipFile::CRCError',
121
- 'Zlib::GzipFile::Error', 'Zlib::GzipFile::LengthError',
122
- 'Zlib::GzipFile::NoFooter', 'Zlib::GzipReader',
123
- 'Zlib::GzipWriter', 'Zlib::Inflate', 'Zlib::MemError',
124
- 'Zlib::NeedDict', 'Zlib::StreamEnd', 'Zlib::StreamError',
125
- 'Zlib::VersionError',
126
- 'Zlib::ZStream',
127
- 'HTML::Selector', 'HashWithIndifferentAccess', 'Inflector',
128
- 'Inflector::Inflections', 'Mime', 'Mime::Type',
129
- 'OCI8AutoRecover', 'TimeZone', 'XmlSimple'
130
- ),
131
- ),
132
- 'SYMBOLS' => array(
133
- '(', ')', '[', ']', '{', '}', '%', '&', '*', '|', '/', '<', '>',
134
- '+', '-', '=>', '<<'
135
- ),
136
- 'CASE_SENSITIVE' => array(
137
- GESHI_COMMENTS => false,
138
- 1 => false,
139
- 2 => false,
140
- 3 => false,
141
- 4 => true,
142
- ),
143
- 'STYLES' => array(
144
- 'KEYWORDS' => array(
145
- 1 => 'color:#9966CC; font-weight:bold;',
146
- 2 => 'color:#0000FF; font-weight:bold;',
147
- 3 => 'color:#CC0066; font-weight:bold;',
148
- 4 => 'color:#CC00FF; font-weight:bold;',
149
- ),
150
- 'COMMENTS' => array(
151
- 1 => 'color:#008000; font-style:italic;',
152
- 4 => 'color: #cc0000; font-style: italic;',
153
- 'MULTI' => 'color:#000080; font-style:italic;'
154
- ),
155
- 'ESCAPE_CHAR' => array(
156
- 0 => 'color:#000099;'
157
- ),
158
- 'BRACKETS' => array(
159
- 0 => 'color:#006600; font-weight:bold;'
160
- ),
161
- 'STRINGS' => array(
162
- 0 => 'color:#996600;'
163
- ),
164
- 'NUMBERS' => array(
165
- 0 => 'color:#006666;'
166
- ),
167
- 'METHODS' => array(
168
- 1 => 'color:#9900CC;'
169
- ),
170
- 'SYMBOLS' => array(
171
- 0 => 'color:#006600; font-weight:bold;'
172
- ),
173
- 'REGEXPS' => array(
174
- 0 => 'color:#ff6633; font-weight:bold;',
175
- 1 => 'color:#0066ff; font-weight:bold;',
176
- 2 => 'color:#6666ff; font-weight:bold;',
177
- 3 => 'color:#ff3333; font-weight:bold;'
178
- ),
179
- 'SCRIPT' => array(
180
- 0 => '',
181
- 1 => '',
182
- 2 => '',
183
- )
184
- ),
185
- 'URLS' => array(
186
- 1 => '',
187
- 2 => '',
188
- 3 => '',
189
- 4 => ''
190
- ),
191
- 'OOLANG' => true,
192
- 'OBJECT_SPLITTERS' => array(
193
- 1 => '.'
194
- ),
195
- 'REGEXPS' => array(
196
- 0 => array(//Variables
197
- GESHI_SEARCH => "([[:space:]])(\\$[a-zA-Z_][a-zA-Z0-9_]*)",
198
- GESHI_REPLACE => '\\2',
199
- GESHI_MODIFIERS => '',
200
- GESHI_BEFORE => '\\1',
201
- GESHI_AFTER => ''
202
- ),
203
- 1 => array(//Arrays
204
- GESHI_SEARCH => "([[:space:]])(@[a-zA-Z_][a-zA-Z0-9_]*)",
205
- GESHI_REPLACE => '\\2',
206
- GESHI_MODIFIERS => '',
207
- GESHI_BEFORE => '\\1',
208
- GESHI_AFTER => ''
209
- ),
210
- 2 => "([A-Z][a-zA-Z0-9_]*::)+[A-Z][a-zA-Z0-9_]*",//Static OOP symbols
211
- 3 => array(
212
- GESHI_SEARCH => "([[:space:]]|\[|\()(:[a-zA-Z_][a-zA-Z0-9_]*)",
213
- GESHI_REPLACE => '\\2',
214
- GESHI_MODIFIERS => '',
215
- GESHI_BEFORE => '\\1',
216
- GESHI_AFTER => ''
217
- )
218
- ),
219
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
220
- 'SCRIPT_DELIMITERS' => array(
221
- 0 => array(
222
- '<%' => '%>'
223
- )
224
- ),
225
- 'HIGHLIGHT_STRICT_BLOCK' => array(
226
- 0 => true,
227
- ),
228
- 'TAB_WIDTH' => 2
229
- );
230
-
231
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/geshi/text.php DELETED
@@ -1,84 +0,0 @@
1
- <?php
2
- /*************************************************************************************
3
- * text.php
4
- * --------
5
- * Author: Sean Hanna (smokingrope@gmail.com)
6
- * Copyright: (c) 2006 Sean Hanna
7
- * Release Version: 1.0.8.10
8
- * Date Started: 04/23/2006
9
- *
10
- * Standard Text File (No Syntax Highlighting).
11
- * Plaintext language file for GeSHi.
12
- *
13
- * CHANGES
14
- * -------
15
- * 04/23/2006 (0.5.0)
16
- * - Syntax File Created
17
- *
18
- * 04/27/2006 (1.0.0)
19
- * - Documentation Cleaned Up
20
- * - First Release
21
- *
22
- * TODO (updated 04/27/2006)
23
- * -------------------------
24
- *
25
- *
26
- *************************************************************************************
27
- *
28
- * This file is part of GeSHi.
29
- *
30
- * GeSHi is free software; you can redistribute it and/or modify
31
- * it under the terms of the GNU General Public License as published by
32
- * the Free Software Foundation; either version 2 of the License, or
33
- * (at your option) any later version.
34
- *
35
- * GeSHi is distributed in the hope that it will be useful,
36
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
37
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38
- * GNU General Public License for more details.
39
- *
40
- * You should have received a copy of the GNU General Public License
41
- * along with GeSHi; if not, write to the Free Software
42
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
43
- *
44
- ************************************************************************************/
45
-
46
- $language_data = array (
47
- 'LANG_NAME' => 'Text',
48
- 'COMMENT_SINGLE' => array(),
49
- 'COMMENT_MULTI' => array(),
50
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
51
- 'QUOTEMARKS' => array(),
52
- 'ESCAPE_CHAR' => '',
53
- 'KEYWORDS' => array(),
54
- 'SYMBOLS' => array(),
55
- 'CASE_SENSITIVE' => array(
56
- GESHI_COMMENTS => false
57
- ),
58
- 'STYLES' => array(
59
- 'KEYWORDS' => array(),
60
- 'COMMENTS' => array(),
61
- 'ESCAPE_CHAR' => array(),
62
- 'BRACKETS' => array(),
63
- 'STRINGS' => array(),
64
- 'NUMBERS' => array(),
65
- 'METHODS' => array(),
66
- 'SYMBOLS' => array(),
67
- 'SCRIPT' => array(),
68
- 'REGEXPS' => array()
69
- ),
70
- 'URLS' => array(),
71
- 'OOLANG' => false,
72
- 'OBJECT_SPLITTERS' => array(),
73
- 'REGEXPS' => array(),
74
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
75
- 'SCRIPT_DELIMITERS' => array(),
76
- 'HIGHLIGHT_STRICT_BLOCK' => array(),
77
- 'PARSER_CONTROL' => array(
78
- 'ENABLE_FLAGS' => array(
79
- 'ALL' => GESHI_NEVER
80
- ),
81
- )
82
- );
83
-
84
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/menu_options.php CHANGED
@@ -17,6 +17,15 @@ var WFSLevels = <?php echo json_encode(wfConfig::$securityLevels); ?>;
17
  <table class="wfConfigForm">
18
  <tr><td colspan="2"><h2>Basic Options</h2></td></tr>
19
  <tr><th>Where to email alerts:</th><td><input type="text" id="alertEmails" name="alertEmails" value="<?php $w->f('alertEmails'); ?>" size="50" />&nbsp;<span class="wfTipText">Separate multiple emails with commas</span></td></tr>
 
 
 
 
 
 
 
 
 
20
  <tr><th>Security Level:</th><td>
21
  <select id="securityLevel" name="securityLevel" onchange="WFAD.changeSecurityLevel(); return true;">
22
  <option value="0"<?php $w->sel('securityLevel', '0'); ?>>Level 0: Disable all Wordfence security measures</option>
@@ -58,9 +67,11 @@ var WFSLevels = <?php echo json_encode(wfConfig::$securityLevels); ?>;
58
  <tr><th class="wfConfigEnable">Enable automatic scheduled scans</th><td><input type="checkbox" id="scheduledScansEnabled" class="wfConfigElem" name="scheduledScansEnabled" value="1" <?php $w->cb('scheduledScansEnabled'); ?> /></td></tr>
59
  <tr><th>Scan core files against repository versions for changes</th><td><input type="checkbox" id="scansEnabled_core" class="wfConfigElem" name="scansEnabled_core" value="1" <?php $w->cb('scansEnabled_core'); ?>/></td></tr>
60
 
61
- <?php if(wfConfig::get('isPaid') == 'paid'){ ?>
62
- <tr><th>Scan theme files against repository versions for changes</th><td><input type="checkbox" id="scansEnabled_themes" class="wfConfigElem" name="scansEnabled_themes" value="1" <?php $w->cb('scansEnabled_themes'); ?>/></td></tr>
63
- <tr><th>Scan plugin files against repository versions for changes</th><td><input type="checkbox" id="scansEnabled_plugins" class="wfConfigElem" name="scansEnabled_plugins" value="1" <?php $w->cb('scansEnabled_plugins'); ?>/></td></tr>
 
 
64
  <?php } else { ?>
65
  <tr><th style="color: #F00; padding-top: 10px;" colspan="2">Only available to Premium Members: <a href="https://www.wordfence.com/choose-a-wordfence-membership-type/" target="_blank">[click to upgrade]</a></th><td></td></tr>
66
  <tr><th style="color: #999;">Scan theme files against repository versions for changes</th><td><input type="checkbox" id="scansEnabled_themes" class="wfConfigElem" name="scansEnabled_themes" value="1" DISABLED /></td></tr>
@@ -176,6 +187,12 @@ var WFSLevels = <?php echo json_encode(wfConfig::$securityLevels); ?>;
176
  <option value="360"<?php $w->sel('loginSec_lockoutMins', '360'); ?>>6 hours</option>
177
  <option value="720"<?php $w->sel('loginSec_lockoutMins', '720'); ?>>12 hours</option>
178
  <option value="1440"<?php $w->sel('loginSec_lockoutMins', '1440'); ?>>1 day</option>
 
 
 
 
 
 
179
  </select>
180
  </td></tr>
181
  <tr><th>Immediately lock out invalid usernames</th><td><input type="checkbox" id="loginSec_lockInvalidUsers" class="wfConfigElem" name="loginSec_lockInvalidUsers" <?php $w->cb('loginSec_lockInvalidUsers'); ?> /></td></tr>
@@ -186,8 +203,8 @@ var WFSLevels = <?php echo json_encode(wfConfig::$securityLevels); ?>;
186
  <tr><th>Scan comments for malware and phishing URL's</th><td><input type="checkbox" id="other_scanComments" class="wfConfigElem" name="other_scanComments" value="1" <?php $w->cb('other_scanComments'); ?> /></td></tr>
187
  <tr><th>Check password strength on profile update</th><td><input type="checkbox" id="other_pwStrengthOnUpdate" class="wfConfigElem" name="other_pwStrengthOnUpdate" value="1" <?php $w->cb('other_pwStrengthOnUpdate'); ?> /></td></tr>
188
  <tr><th>Participate in the Wordfence Security Network</th><td><input type="checkbox" id="other_WFNet" class="wfConfigElem" name="other_WFNet" value="1" <?php $w->cb('other_WFNet'); ?> /></td></tr>
189
- <tr><th>Your Wordfence API Key</th><td><input type="text" id="apiKey" name="apiKey" value="<?php $w->f('apiKey'); ?>" size="20" /></td></tr>
190
  <tr><th>Maximum memory Wordfence can use</th><td><input type="text" id="maxMem" name="maxMem" value="<?php $w->f('maxMem'); ?>" size="4" />Megabytes</td></tr>
 
191
  <tr><th colspan="2"><a href="/?_wfsf=sysinfo&nonce=<?php echo wp_create_nonce('wp-ajax'); ?>" target="_blank">Click to view your system's configuration in a new window</a></th></tr>
192
  </table>
193
  <p><table border="0" cellpadding="0" cellspacing="0"><tr><td><input type="button" id="button1" name="button1" class="button-primary" value="Save Changes" onclick="WFAD.saveConfig();" /></td><td style="height: 24px;"><div class="wfAjax24"></div><span class="wfSavedMsg">&nbsp;Your changes have been saved!</span></td></tr></table></p>
17
  <table class="wfConfigForm">
18
  <tr><td colspan="2"><h2>Basic Options</h2></td></tr>
19
  <tr><th>Where to email alerts:</th><td><input type="text" id="alertEmails" name="alertEmails" value="<?php $w->f('alertEmails'); ?>" size="50" />&nbsp;<span class="wfTipText">Separate multiple emails with commas</span></td></tr>
20
+ <tr><th>Your Wordfence API Key:</th><td><input type="text" id="apiKey" name="apiKey" value="<?php $w->f('apiKey'); ?>" size="50" />
21
+ </td></tr>
22
+ <tr><th>Key type currently active:</th><td>
23
+ <?php if(wfConfig::get('isPaid')){ ?>
24
+ The currently active API Key is a Premium Key. <span style="font-weight: bold; color: #0A0;">Premium scanning enabled!</span>
25
+ <?php } else {?>
26
+ The currently active API Key is a <span style="color: #F00; font-weight: bold;">Free Key</a>. <a href="https://www.wordfence.com/choose-a-wordfence-membership-type/?s2-ssl=yes" target="_blank">Upgrade to Premium Scanning now.</a>
27
+ <?php } ?>
28
+ </td></tr>
29
  <tr><th>Security Level:</th><td>
30
  <select id="securityLevel" name="securityLevel" onchange="WFAD.changeSecurityLevel(); return true;">
31
  <option value="0"<?php $w->sel('securityLevel', '0'); ?>>Level 0: Disable all Wordfence security measures</option>
67
  <tr><th class="wfConfigEnable">Enable automatic scheduled scans</th><td><input type="checkbox" id="scheduledScansEnabled" class="wfConfigElem" name="scheduledScansEnabled" value="1" <?php $w->cb('scheduledScansEnabled'); ?> /></td></tr>
68
  <tr><th>Scan core files against repository versions for changes</th><td><input type="checkbox" id="scansEnabled_core" class="wfConfigElem" name="scansEnabled_core" value="1" <?php $w->cb('scansEnabled_core'); ?>/></td></tr>
69
 
70
+ <?php if(wfConfig::get('isPaid')){ ?>
71
+ <tr><th style="color: #0A0; padding-top: 10px; font-weight: bold;" colspan="2">Premium Scanning:</th><td></td></tr>
72
+ <tr><th style="font-weight: bold;">Scan theme files against repository versions for changes</th><td><input type="checkbox" id="scansEnabled_themes" class="wfConfigElem" name="scansEnabled_themes" value="1" <?php $w->cb('scansEnabled_themes'); ?>/></td></tr>
73
+ <tr><th style="font-weight: bold;">Scan plugin files against repository versions for changes</th><td><input type="checkbox" id="scansEnabled_plugins" class="wfConfigElem" name="scansEnabled_plugins" value="1" <?php $w->cb('scansEnabled_plugins'); ?>/></td></tr>
74
+ <tr><td colspan="2">&nbsp;</td></tr>
75
  <?php } else { ?>
76
  <tr><th style="color: #F00; padding-top: 10px;" colspan="2">Only available to Premium Members: <a href="https://www.wordfence.com/choose-a-wordfence-membership-type/" target="_blank">[click to upgrade]</a></th><td></td></tr>
77
  <tr><th style="color: #999;">Scan theme files against repository versions for changes</th><td><input type="checkbox" id="scansEnabled_themes" class="wfConfigElem" name="scansEnabled_themes" value="1" DISABLED /></td></tr>
187
  <option value="360"<?php $w->sel('loginSec_lockoutMins', '360'); ?>>6 hours</option>
188
  <option value="720"<?php $w->sel('loginSec_lockoutMins', '720'); ?>>12 hours</option>
189
  <option value="1440"<?php $w->sel('loginSec_lockoutMins', '1440'); ?>>1 day</option>
190
+ <option value="2880"<?php $w->sel('loginSec_lockoutMins', '2880'); ?>>2 days</option>
191
+ <option value="7200"<?php $w->sel('loginSec_lockoutMins', '7200'); ?>>5 days</option>
192
+ <option value="14400"<?php $w->sel('loginSec_lockoutMins', '14400'); ?>>10 days</option>
193
+ <option value="28800"<?php $w->sel('loginSec_lockoutMins', '28800'); ?>>20 days</option>
194
+ <option value="43200"<?php $w->sel('loginSec_lockoutMins', '43200'); ?>>30 days</option>
195
+ <option value="86400"<?php $w->sel('loginSec_lockoutMins', '86400'); ?>>60 days</option>
196
  </select>
197
  </td></tr>
198
  <tr><th>Immediately lock out invalid usernames</th><td><input type="checkbox" id="loginSec_lockInvalidUsers" class="wfConfigElem" name="loginSec_lockInvalidUsers" <?php $w->cb('loginSec_lockInvalidUsers'); ?> /></td></tr>
203
  <tr><th>Scan comments for malware and phishing URL's</th><td><input type="checkbox" id="other_scanComments" class="wfConfigElem" name="other_scanComments" value="1" <?php $w->cb('other_scanComments'); ?> /></td></tr>
204
  <tr><th>Check password strength on profile update</th><td><input type="checkbox" id="other_pwStrengthOnUpdate" class="wfConfigElem" name="other_pwStrengthOnUpdate" value="1" <?php $w->cb('other_pwStrengthOnUpdate'); ?> /></td></tr>
205
  <tr><th>Participate in the Wordfence Security Network</th><td><input type="checkbox" id="other_WFNet" class="wfConfigElem" name="other_WFNet" value="1" <?php $w->cb('other_WFNet'); ?> /></td></tr>
 
206
  <tr><th>Maximum memory Wordfence can use</th><td><input type="text" id="maxMem" name="maxMem" value="<?php $w->f('maxMem'); ?>" size="4" />Megabytes</td></tr>
207
+ <tr><th>Enable debugging mode</th><td><input type="checkbox" id="debugOn" class="wfConfigElem" name="debugOn" value="1" <?php $w->cb('debugOn'); ?> /></td></tr>
208
  <tr><th colspan="2"><a href="/?_wfsf=sysinfo&nonce=<?php echo wp_create_nonce('wp-ajax'); ?>" target="_blank">Click to view your system's configuration in a new window</a></th></tr>
209
  </table>
210
  <p><table border="0" cellpadding="0" cellspacing="0"><tr><td><input type="button" id="button1" name="button1" class="button-primary" value="Save Changes" onclick="WFAD.saveConfig();" /></td><td style="height: 24px;"><div class="wfAjax24"></div><span class="wfSavedMsg">&nbsp;Your changes have been saved!</span></td></tr></table></p>
lib/menu_scan.php CHANGED
@@ -20,18 +20,31 @@
20
  </div>
21
  <?php } ?>
22
  </div></div></div>
23
- <div class="consoleHead">
 
 
 
 
 
 
 
 
 
 
24
  <span class="consoleHeadText">Scan Detailed Activity</span>
25
- <a href="#" class="wfALogMailLink" onclick="WFAD.emailActivityLog(); return false;">Email Activity Log</a>
26
  </div>
27
  <div class="bevelDiv1 consoleOuter"><div class="bevelDiv2"><div class="bevelDiv3 consoleInner" id="consoleActivity">
28
  <?php
29
  if(sizeof($events) > 0){
 
30
  $newestItem = 0;
31
  $sumEvents = array();
32
  foreach($events as $e){
33
  if(strpos($e['msg'], 'SUM_') !== 0){
34
- echo '<div class="wfActivityLine wf' . $e['type'] . '">[' . date('M d H:i:s', $e['ctime']) . ']&nbsp;' . $e['msg'] . '</div>';
 
 
35
  }
36
  $newestItem = $e['ctime'];
37
  }
@@ -44,6 +57,10 @@
44
  }
45
  ?>
46
  </div></div></div>
 
 
 
 
47
  </div>
48
  <div style="margin-top: 20px;">
49
  <div id="wfTabs">
@@ -283,6 +300,11 @@
283
  <tr><th>Author</th><td>${data.author}</td></tr>
284
  <tr><th>Bad URL:</th><td><strong class="wfWarn">${data.badURL}</strong></td></tr>
285
  <tr><th>Posted on:</th><td>${data.commentDate}</td></tr>
 
 
 
 
 
286
  <tr><th>Severity:</th><td>Critical</td></tr>
287
  <tr><th>Status</th><td>
288
  {{if status == 'new' }}New{{/if}}
@@ -316,9 +338,18 @@
316
  <h2>${shortMsg}</h2>
317
  <p>
318
  <table border="0" class="wfIssue" cellspacing="0" cellpadding="0">
 
 
 
319
  <tr><th>Title:</th><td><a href="${data.permalink}" target="_blank">${data.postTitle}</a></td></tr>
 
320
  <tr><th>Bad URL:</th><td><strong class="wfWarn">${data.badURL}</strong></td></tr>
321
  <tr><th>Posted on:</th><td>${data.postDate}</td></tr>
 
 
 
 
 
322
  <tr><th>Severity:</th><td>Critical</td></tr>
323
  <tr><th>Status</th><td>
324
  {{if status == 'new' }}New{{/if}}
20
  </div>
21
  <?php } ?>
22
  </div></div></div>
23
+ <?php if(wfConfig::get('isPaid')){ ?>
24
+ <div style="margin: 0 0 20px 5px; width: 795px; font-weight: bold; color: #0A0;">
25
+ Premium scanning enabled.
26
+ </div>
27
+ <?php } else { ?>
28
+ <div style="margin: 0 0 20px 5px; width: 795px;">
29
+ <strong>How to upgrade:</strong> <a href="https://www.wordfence.com/choose-a-wordfence-membership-type/?s2-ssl=yes" target="_blank">Visit www.wordfence.com</a> and sign up for a paid option. Then go to the Wordfence options page on this site and replace your free API key with your new premium key. You will then be able to activate the premium scanning options on the Wordfence options page.
30
+ </div>
31
+
32
+ <?php } ?>
33
+ <div class="consoleHead" style="margin-top: 20px;">
34
  <span class="consoleHeadText">Scan Detailed Activity</span>
35
+ <a href="#" class="wfALogMailLink" onclick="WFAD.emailActivityLog(); return false;">Email activity log</a>
36
  </div>
37
  <div class="bevelDiv1 consoleOuter"><div class="bevelDiv2"><div class="bevelDiv3 consoleInner" id="consoleActivity">
38
  <?php
39
  if(sizeof($events) > 0){
40
+ $debugOn = wfConfig::get('debugOn', false);
41
  $newestItem = 0;
42
  $sumEvents = array();
43
  foreach($events as $e){
44
  if(strpos($e['msg'], 'SUM_') !== 0){
45
+ if( $debugOn || $e['level'] < 4){
46
+ echo '<div class="wfActivityLine wf' . $e['type'] . '">[' . date('M d H:i:s', $e['ctime']) . ']&nbsp;' . $e['msg'] . '</div>';
47
+ }
48
  }
49
  $newestItem = $e['ctime'];
50
  }
57
  }
58
  ?>
59
  </div></div></div>
60
+ <div style="position: relative; width: 803px;">
61
+ &nbsp;
62
+ <a href="#" target="_blank" class="wfALogViewLink" id="wfALogViewLink">View activity log</a>
63
+ </div>
64
  </div>
65
  <div style="margin-top: 20px;">
66
  <div id="wfTabs">
300
  <tr><th>Author</th><td>${data.author}</td></tr>
301
  <tr><th>Bad URL:</th><td><strong class="wfWarn">${data.badURL}</strong></td></tr>
302
  <tr><th>Posted on:</th><td>${data.commentDate}</td></tr>
303
+ {{if data.isMultisite}}
304
+ <tr><th>Multisite Blog ID:</th><td>${data.blog_id}</td></tr>
305
+ <tr><th>Multisite Blog Domain:</th><td>${data.domain}</td></tr>
306
+ <tr><th>Multisite Blog Path:</th><td>${data.path}</td></tr>
307
+ {{/if}}
308
  <tr><th>Severity:</th><td>Critical</td></tr>
309
  <tr><th>Status</th><td>
310
  {{if status == 'new' }}New{{/if}}
338
  <h2>${shortMsg}</h2>
339
  <p>
340
  <table border="0" class="wfIssue" cellspacing="0" cellpadding="0">
341
+ {{if data.isMultisite}}
342
+ <tr><th>Title:</th><td><a href="${data.permalink}" target="_blank">${data.postTitle}</a></td></tr>
343
+ {{else}}
344
  <tr><th>Title:</th><td><a href="${data.permalink}" target="_blank">${data.postTitle}</a></td></tr>
345
+ {{/if}}
346
  <tr><th>Bad URL:</th><td><strong class="wfWarn">${data.badURL}</strong></td></tr>
347
  <tr><th>Posted on:</th><td>${data.postDate}</td></tr>
348
+ {{if data.isMultisite}}
349
+ <tr><th>Multisite Blog ID:</th><td>${data.blog_id}</td></tr>
350
+ <tr><th>Multisite Blog Domain:</th><td>${data.domain}</td></tr>
351
+ <tr><th>Multisite Blog Path:</th><td>${data.path}</td></tr>
352
+ {{/if}}
353
  <tr><th>Severity:</th><td>Critical</td></tr>
354
  <tr><th>Status</th><td>
355
  {{if status == 'new' }}New{{/if}}
lib/sysinfo.php CHANGED
@@ -3,7 +3,7 @@
3
  <head>
4
  <title>Wordfence System Info</title>
5
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
- <link rel='stylesheet' id='wordfence-main-style-css' href='<?php echo wfUtils::getBaseURL(); ?>/css/phpinfo.css?ver=<?php echo WORDFENCE_VERSION ?>' type='text/css' media='all' />
7
  <body>
8
  <?php
9
  ob_start();
3
  <head>
4
  <title>Wordfence System Info</title>
5
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <link rel='stylesheet' id='wordfence-main-style-css' href='<?php echo wfUtils::getBaseURL(); ?>/css/phpinfo.css?ver=<?php echo wfUtils::myVersion(); ?>' type='text/css' media='all' />
7
  <body>
8
  <?php
9
  ob_start();
lib/viewFullActivityLog.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if(! wordfence::isAdmin()){ exit(); } ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
+ <link rel='stylesheet' id='wordfence-main-style-css' href='<?php echo wfUtils::getBaseURL(); ?>/css/fullLog.css?ver=<?php echo wfUtils::myVersion(); ?>' type='text/css' media='all' />
6
+ <style type="text/css">
7
+
8
+ </style>
9
+ <body>
10
+ <h1>Wordfence Full Activity Log</h1>
11
+ <?php
12
+ $db = new wfDB();
13
+ global $wpdb;
14
+ $table = $wpdb->base_prefix . 'wfStatus';
15
+ $q = $db->query("select ctime, level, type, msg from $table order by ctime desc");
16
+ while($r = mysql_fetch_assoc($q)){
17
+ echo '<div' . ($r['type'] == 'error' ? ' class="error"' : '') . '>[' . date('M d H:i:s', $r['ctime']) . ':' . $r['ctime'] . ':' . $r['level'] . ':' . $r['type'] . ']&nbsp;' . htmlspecialchars($r['msg']) . "</div>\n";
18
+ }
19
+ ?>
20
+ </body>
21
+ </html>
22
+ <?php exit(0); ?>
lib/wfConfig.php CHANGED
@@ -39,7 +39,8 @@ class wfConfig {
39
  "other_scanComments" => false,
40
  "other_pwStrengthOnUpdate" => false,
41
  "other_WFNet" => true,
42
- "other_scanOutside" => false
 
43
  ),
44
  "otherParams" => array(
45
  'securityLevel' => '0',
@@ -100,7 +101,8 @@ class wfConfig {
100
  "other_scanComments" => true,
101
  "other_pwStrengthOnUpdate" => true,
102
  "other_WFNet" => true,
103
- "other_scanOutside" => false
 
104
  ),
105
  "otherParams" => array(
106
  'securityLevel' => '1',
@@ -161,7 +163,8 @@ class wfConfig {
161
  "other_scanComments" => true,
162
  "other_pwStrengthOnUpdate" => true,
163
  "other_WFNet" => true,
164
- "other_scanOutside" => false
 
165
  ),
166
  "otherParams" => array(
167
  'securityLevel' => '2',
@@ -222,7 +225,8 @@ class wfConfig {
222
  "other_scanComments" => true,
223
  "other_pwStrengthOnUpdate" => true,
224
  "other_WFNet" => true,
225
- "other_scanOutside" => false
 
226
  ),
227
  "otherParams" => array(
228
  'securityLevel' => '3',
@@ -283,7 +287,8 @@ class wfConfig {
283
  "other_scanComments" => true,
284
  "other_pwStrengthOnUpdate" => true,
285
  "other_WFNet" => true,
286
- "other_scanOutside" => false
 
287
  ),
288
  "otherParams" => array(
289
  'securityLevel' => '4',
@@ -375,7 +380,7 @@ class wfConfig {
375
  public static function get($key, $default = false){
376
  if(! isset(self::$cache[$key])){
377
  $val = self::getDB()->querySingle("select val from " . self::table() . " where name='%s'", $key);
378
- if($val){
379
  self::$cache[$key] = $val;
380
  } else {
381
  self::$cache[$key] = $default;
39
  "other_scanComments" => false,
40
  "other_pwStrengthOnUpdate" => false,
41
  "other_WFNet" => true,
42
+ "other_scanOutside" => false,
43
+ "debugOn" => false
44
  ),
45
  "otherParams" => array(
46
  'securityLevel' => '0',
101
  "other_scanComments" => true,
102
  "other_pwStrengthOnUpdate" => true,
103
  "other_WFNet" => true,
104
+ "other_scanOutside" => false,
105
+ "debugOn" => false
106
  ),
107
  "otherParams" => array(
108
  'securityLevel' => '1',
163
  "other_scanComments" => true,
164
  "other_pwStrengthOnUpdate" => true,
165
  "other_WFNet" => true,
166
+ "other_scanOutside" => false,
167
+ "debugOn" => false
168
  ),
169
  "otherParams" => array(
170
  'securityLevel' => '2',
225
  "other_scanComments" => true,
226
  "other_pwStrengthOnUpdate" => true,
227
  "other_WFNet" => true,
228
+ "other_scanOutside" => false,
229
+ "debugOn" => false
230
  ),
231
  "otherParams" => array(
232
  'securityLevel' => '3',
287
  "other_scanComments" => true,
288
  "other_pwStrengthOnUpdate" => true,
289
  "other_WFNet" => true,
290
+ "other_scanOutside" => false,
291
+ "debugOn" => false
292
  ),
293
  "otherParams" => array(
294
  'securityLevel' => '4',
380
  public static function get($key, $default = false){
381
  if(! isset(self::$cache[$key])){
382
  $val = self::getDB()->querySingle("select val from " . self::table() . " where name='%s'", $key);
383
+ if(isset($val)){
384
  self::$cache[$key] = $val;
385
  } else {
386
  self::$cache[$key] = $default;
lib/wfDB.php CHANGED
@@ -6,6 +6,7 @@ class wfDB {
6
  private $dbpassword = false;
7
  private $dbname = false;
8
  private $dbuser = false;
 
9
  public function __construct($createNewHandle = false, $dbhost = false, $dbuser = false, $dbpassword = false, $dbname = false){
10
  if($dbhost && $dbuser && $dbpassword && $dbname){
11
  $this->dbhost = $dbhost;
@@ -14,7 +15,15 @@ class wfDB {
14
  $this->dbname = $dbname;
15
  } else {
16
  global $wpdb;
17
- if(! $wpdb){ die("Not running under wordpress. Please supply db credentials to constructor."); }
 
 
 
 
 
 
 
 
18
  $this->dbhost = $wpdb->dbhost;
19
  $this->dbuser = $wpdb->dbuser;
20
  $this->dbpassword = $wpdb->dbpassword;
@@ -22,6 +31,10 @@ class wfDB {
22
  }
23
  if($createNewHandle){
24
  $dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
 
 
 
 
25
  mysql_select_db($this->dbname, $dbh);
26
  $this->dbh = $dbh;
27
  } else {
@@ -29,6 +42,11 @@ class wfDB {
29
  $this->dbh = self::$dbhCache;
30
  } else {
31
  $dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
 
 
 
 
 
32
  mysql_select_db($this->dbname, $dbh);
33
  self::$dbhCache = $dbh;
34
  $this->dbh = self::$dbhCache;
@@ -99,7 +117,7 @@ class wfDB {
99
  exit(1);
100
  }
101
  public function createKeyIfNotExists($table, $col, $keyName){
102
- global $wpdb; $prefix = $wpdb->prefix;
103
  $table = $prefix . $table;
104
  $exists = $this->querySingle("show tables like '$table'");
105
  $keyFound = false;
6
  private $dbpassword = false;
7
  private $dbname = false;
8
  private $dbuser = false;
9
+ public $errorMsg = false;
10
  public function __construct($createNewHandle = false, $dbhost = false, $dbuser = false, $dbpassword = false, $dbname = false){
11
  if($dbhost && $dbuser && $dbpassword && $dbname){
12
  $this->dbhost = $dbhost;
15
  $this->dbname = $dbname;
16
  } else {
17
  global $wpdb;
18
+ if(! $wpdb){
19
+ $this->errorMsg = "The WordPress variable wpdb is not defined.";
20
+ return;
21
+ }
22
+ if(! $wpdb->dbhost ){ $this->errorMsg = "The WordPress variable from wpdb dbhost is not defined."; }
23
+ if(! $wpdb->dbuser ){ $this->errorMsg = "The WordPress variable from wpdb dbuser is not defined."; }
24
+ if(! $wpdb->dbpassword ){ $this->errorMsg = "The WordPress variable from wpdb dbpassword is not defined."; }
25
+ if(! $wpdb->dbname ){ $this->errorMsg = "The WordPress variable from wpdb dbname is not defined."; }
26
+ if($this->errorMsg){ return; }
27
  $this->dbhost = $wpdb->dbhost;
28
  $this->dbuser = $wpdb->dbuser;
29
  $this->dbpassword = $wpdb->dbpassword;
31
  }
32
  if($createNewHandle){
33
  $dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
34
+ if($dbh === false){
35
+ $this->errorMsg = "Could not connect to database on " . $this->dbhost . " with user " . $this->dbuser;
36
+ return;
37
+ }
38
  mysql_select_db($this->dbname, $dbh);
39
  $this->dbh = $dbh;
40
  } else {
42
  $this->dbh = self::$dbhCache;
43
  } else {
44
  $dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
45
+ if($dbh === false){
46
+ $this->errorMsg = "Could not connect to database on " . $this->dbhost . " with user " . $this->dbuser;
47
+ return;
48
+ }
49
+
50
  mysql_select_db($this->dbname, $dbh);
51
  self::$dbhCache = $dbh;
52
  $this->dbh = self::$dbhCache;
117
  exit(1);
118
  }
119
  public function createKeyIfNotExists($table, $col, $keyName){
120
+ global $wpdb; $prefix = $wpdb->base_prefix;
121
  $table = $prefix . $table;
122
  $exists = $this->querySingle("show tables like '$table'");
123
  $keyFound = false;
lib/wfLog.php CHANGED
@@ -573,7 +573,7 @@ class wfLog {
573
  }
574
  public function addStatus($level, $type, $msg){
575
  //$msg = '[' . sprintf('%.2f', memory_get_usage(true) / (1024 * 1024)) . '] ' . $msg;
576
- $this->getDB()->query("insert into " . $this->statusTable . " (ctime, level, type, msg) values (%s, %d, '%s', '%s')", microtime(true), $level, $type, $msg);
577
  }
578
  public function getStatusEvents($lastCtime){
579
  if($lastCtime < 1){
573
  }
574
  public function addStatus($level, $type, $msg){
575
  //$msg = '[' . sprintf('%.2f', memory_get_usage(true) / (1024 * 1024)) . '] ' . $msg;
576
+ $this->getDB()->query("insert into " . $this->statusTable . " (ctime, level, type, msg) values (%s, %d, '%s', '%s')", sprintf('%.6f', microtime(true)), $level, $type, $msg);
577
  }
578
  public function getStatusEvents($lastCtime){
579
  if($lastCtime < 1){
lib/wfScanEngine.php CHANGED
@@ -111,21 +111,27 @@ class wfScanEngine {
111
  } else {
112
  wordfence::statusDisabled("Skipping core scan");
113
  }
114
- if(wfConfig::get('scansEnabled_plugins')){
115
- $pluginScanEnabled = true;
116
- $statusIDX['plugin'] = wordfence::statusStart("Comparing plugin files against originals in repository");
 
 
 
 
117
  } else {
118
- wordfence::statusDisabled("Skipping plugin scan");
119
- $this->status(2, 'info', "Skipping plugin scan because it's disabled.");
120
- }
121
- if(wfConfig::get('scansEnabled_themes')){
122
- $themeScanEnabled = true;
123
- $statusIDX['theme'] = wordfence::statusStart("Comparing theme files against originals in repository");
 
 
 
124
  } else {
125
- wordfence::statusDisabled("Skipping theme scan");
126
- $this->status(2, 'info', "Skipping themes scan because it's disabled.");
127
  }
128
-
129
  if(wfConfig::get('scansEnabled_malware')){
130
  $statusIDX['unknown'] = wordfence::statusStart("Scanning for known malware files");
131
  $malwareScanEnabled = true;
@@ -272,21 +278,27 @@ class wfScanEngine {
272
  }
273
  private function scanPosts(){
274
  $statusIDX = wordfence::statusStart('Scanning posts for URL\'s in Google\'s Safe Browsing List');
275
- global $wpdb;
276
  $wfdb = new wfDB();
277
- $q1 = $wfdb->query("select ID from $wpdb->posts where post_type IN ('page', 'post') and post_status = 'publish'");
278
  $h = new wordfenceURLHoover($this->apiKey, $this->wp_version);
279
  $postDat = array();
280
- while($idRow = mysql_fetch_assoc($q1)){
281
- $row = $wfdb->querySingleRec("select ID, post_title, post_type, post_date, post_content from $wpdb->posts where ID=%d", $idRow['ID']);
282
- $h->hoover($row['ID'], $row['post_title'] . ' ' . $row['post_content']);
283
- $postDat[$row['ID']] = array(
284
- 'contentMD5' => md5($row['post_content']),
285
- 'title' => $row['post_title'],
286
- 'type' => $row['post_type'],
287
- 'postDate' => $row['post_date']
288
- );
 
 
 
 
 
 
289
 
 
290
  }
291
  $this->status(2, 'info', "Examining URLs found in posts we scanned for dangerous websites");
292
  $hooverResults = $h->getBaddies();
@@ -298,9 +310,12 @@ class wfScanEngine {
298
 
299
  }
300
  $haveIssues = false;
301
- foreach($hooverResults as $id => $hresults){
302
- $uctype = ucfirst($postDat[$id]['type']);
303
- $type = $postDat[$id]['type'];
 
 
 
304
  foreach($hresults as $result){
305
  if($result['badList'] == 'goog-malware-shavar'){
306
  $shortMsg = "$uctype contains a suspected malware URL.";
@@ -313,18 +328,30 @@ class wfScanEngine {
313
  continue;
314
  }
315
  $this->status(2, 'info', "Adding issue: $shortMsg");
316
- if($this->addIssue('postBadURL', 1, $id, $id . $postDat[$id]['contentMD5'], $shortMsg, $longMsg, array(
317
- 'postID' => $id,
 
 
 
 
 
318
  'badURL' => $result['URL'],
319
- 'postTitle' => $postDat[$id]['title'],
320
- 'type' => $postDat[$id]['type'],
321
  'uctype' => $uctype,
322
- 'permalink' => get_permalink($id),
323
- 'editPostLink' => get_edit_post_link($id),
324
- 'postDate' => $postDat[$id]['postDate']
 
 
 
 
325
  ))){
326
  $haveIssues = true;
327
  }
 
 
 
328
  }
329
  }
330
  wordfence::statusEnd($statusIDX, $haveIssues);
@@ -369,27 +396,33 @@ class wfScanEngine {
369
  $statusIDX = wordfence::statusStart('Scanning comments for URL\'s in Google\'s Safe Browsing List');
370
  global $wpdb;
371
  $wfdb = new wfDB();
372
- $q1 = $wfdb->query("select comment_ID from $wpdb->comments where comment_approved=1");
373
- if( ! $q1){
374
- wordfence::statusEndErr();
375
- return;
376
- }
377
- if(! (mysql_num_rows($q1) > 0)){
378
- wordfence::statusEnd($statusIDX, false);
379
- return;
380
- }
381
-
382
- $h = new wordfenceURLHoover($this->apiKey, $this->wp_version);
383
  $commentDat = array();
384
- while($idRow = mysql_fetch_assoc($q1)){
385
- $row = $wfdb->querySingleRec("select comment_ID, comment_date, comment_type, comment_author, comment_author_url, comment_content from $wpdb->comments where comment_ID=%d", $idRow['comment_ID']);
386
- $h->hoover($row['comment_ID'], $row['comment_author_url'] . ' ' . $row['comment_author'] . ' ' . $row['comment_content']);
387
- $commentDat[$row['comment_ID']] = array(
388
- 'contentMD5' => md5($row['comment_content'] . $row['comment_author'] . $row['comment_author_url']),
389
- 'author' => $row['comment_author'],
390
- 'type' => ($row['comment_type'] ? $row['comment_type'] : 'comment'),
391
- 'date' => $row['comment_date']
392
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
393
  }
394
  $hooverResults = $h->getBaddies();
395
  if($h->errorMsg){
@@ -398,9 +431,12 @@ class wfScanEngine {
398
  return;
399
  }
400
  $haveIssues = false;
401
- foreach($hooverResults as $id => $hresults){
402
- $uctype = ucfirst($commentDat[$id]['type']);
403
- $type = $commentDat[$id]['type'];
 
 
 
404
  foreach($hresults as $result){
405
  if($result['badList'] == 'goog-malware-shavar'){
406
  $shortMsg = "$uctype contains a suspected malware URL.";
@@ -412,21 +448,60 @@ class wfScanEngine {
412
  //A list type that may be new and the plugin has not been upgraded yet.
413
  continue;
414
  }
415
- if($this->addIssue('commentBadURL', 1, $id, $id . $commentDat[$id]['contentMD5'], $shortMsg, $longMsg, array(
416
- 'commentID' => $id,
 
 
 
 
 
417
  'badURL' => $result['URL'],
418
- 'author' => $commentDat[$id]['author'],
419
  'type' => $type,
420
  'uctype' => $uctype,
421
- 'editCommentLink' => get_edit_comment_link($id),
422
- 'commentDate' => $commentDat[$id]['date']
 
 
 
 
423
  ))){
424
  $haveIssues = true;
425
  }
 
 
 
426
  }
427
  }
428
  wordfence::statusEnd($statusIDX, $haveIssues);
429
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
430
  private function highestCap($caps){
431
  foreach(array('administrator', 'editor', 'author', 'contributor', 'subscriber') as $cap){
432
  if(empty($caps[$cap]) === false && $caps[$cap]){
@@ -550,6 +625,7 @@ class wfScanEngine {
550
  $currentCNAME = implode(', ', $cnameArr);
551
  $loggedCNAME = wfConfig::get('wf_dnsCNAME');
552
  $dnsLogged = wfConfig::get('wf_dnsLogged', false);
 
553
  if($dnsLogged && $loggedCNAME != $currentCNAME){
554
  if($this->addIssue('dnsChange', 2, 'dnsChanges', 'dnsChanges', "Your DNS records have changed", "We have detected a change in the CNAME records of your DNS configuration for the domain $host. A CNAME record is an alias that is used to point a domain name to another domain name. For example foo.example.com can point to bar.example.com which then points to an IP address of 10.1.1.1. $msg", array(
555
  'type' => 'CNAME',
@@ -576,7 +652,6 @@ class wfScanEngine {
576
  $currentA = implode(', ', $aArr);
577
  $loggedA = wfConfig::get('wf_dnsA');
578
  $dnsLogged = wfConfig::get('wf_dnsLogged', false);
579
- $msg = "A change in your DNS records may indicate that a hacker has hacked into your DNS administration system and has pointed your email or website to their own server for malicious purposes. It could also indicate that your domain has expired. If you made this change yourself you can mark it 'resolved' and safely ignore it.";
580
  if($dnsLogged && $loggedA != $currentA){
581
  if($this->addIssue('dnsChange', 2, 'dnsChanges', 'dnsChanges', "Your DNS records have changed", "We have detected a change in the A records of your DNS configuration that may affect the domain $host. An A record is a record in DNS that points a domain name to an IP address. $msg", array(
582
  'type' => 'A',
111
  } else {
112
  wordfence::statusDisabled("Skipping core scan");
113
  }
114
+ if(wfConfig::get('isPaid')){
115
+ if(wfConfig::get('scansEnabled_plugins')){
116
+ $pluginScanEnabled = true;
117
+ $statusIDX['plugin'] = wordfence::statusStart("Premium: Comparing plugin files against originals in repository");
118
+ } else {
119
+ wordfence::statusDisabled("Skipping comparing plugin files against originals in repository");
120
+ }
121
  } else {
122
+ wordfence::statusPaidOnly("Skipping comparing plugin files against originals in repository");
123
+ }
124
+ if(wfConfig::get('isPaid')){
125
+ if(wfConfig::get('scansEnabled_themes')){
126
+ $themeScanEnabled = true;
127
+ $statusIDX['theme'] = wordfence::statusStart("Premium: Comparing theme files against originals in repository");
128
+ } else {
129
+ wordfence::statusDisabled("Skipping comparing theme files against originals in repository");
130
+ }
131
  } else {
132
+ wordfence::statusPaidOnly("Skipping comparing theme files against originals in repository");
 
133
  }
134
+
135
  if(wfConfig::get('scansEnabled_malware')){
136
  $statusIDX['unknown'] = wordfence::statusStart("Scanning for known malware files");
137
  $malwareScanEnabled = true;
278
  }
279
  private function scanPosts(){
280
  $statusIDX = wordfence::statusStart('Scanning posts for URL\'s in Google\'s Safe Browsing List');
281
+ $blogsToScan = $this->getBlogsToScan('posts');
282
  $wfdb = new wfDB();
 
283
  $h = new wordfenceURLHoover($this->apiKey, $this->wp_version);
284
  $postDat = array();
285
+ foreach($blogsToScan as $blog){
286
+ $q1 = $wfdb->query("select ID from " . $blog['table'] . " where post_type IN ('page', 'post') and post_status = 'publish'");
287
+ while($idRow = mysql_fetch_assoc($q1)){
288
+ $row = $wfdb->querySingleRec("select ID, post_title, post_type, post_date, post_content from " . $blog['table'] . " where ID=%d", $idRow['ID']);
289
+ $h->hoover($blog['blog_id'] . '-' . $row['ID'], $row['post_title'] . ' ' . $row['post_content']);
290
+ $postDat[$blog['blog_id'] . '-' . $row['ID']] = array(
291
+ 'contentMD5' => md5($row['post_content']),
292
+ 'title' => $row['post_title'],
293
+ 'type' => $row['post_type'],
294
+ 'postDate' => $row['post_date'],
295
+ 'isMultisite' => $blog['isMultisite'],
296
+ 'domain' => $blog['domain'],
297
+ 'path' => $blog['path'],
298
+ 'blog_id' => $blog['blog_id']
299
+ );
300
 
301
+ }
302
  }
303
  $this->status(2, 'info', "Examining URLs found in posts we scanned for dangerous websites");
304
  $hooverResults = $h->getBaddies();
310
 
311
  }
312
  $haveIssues = false;
313
+ foreach($hooverResults as $idString => $hresults){
314
+ $arr = explode('-', $idString);
315
+ $blogID = $arr[0];
316
+ $postID = $arr[1];
317
+ $uctype = ucfirst($postDat[$idString]['type']);
318
+ $type = $postDat[$idString]['type'];
319
  foreach($hresults as $result){
320
  if($result['badList'] == 'goog-malware-shavar'){
321
  $shortMsg = "$uctype contains a suspected malware URL.";
328
  continue;
329
  }
330
  $this->status(2, 'info', "Adding issue: $shortMsg");
331
+ if(is_multisite()){
332
+ switch_to_blog($blogID);
333
+ }
334
+ $ignoreP = $idString;
335
+ $ignoreC = $idString . $postDat[$idString]['contentMD5'];
336
+ if($this->addIssue('postBadURL', 1, $ignoreP, $ignoreC, $shortMsg, $longMsg, array(
337
+ 'postID' => $postID,
338
  'badURL' => $result['URL'],
339
+ 'postTitle' => $postDat[$idString]['title'],
340
+ 'type' => $postDat[$idString]['type'],
341
  'uctype' => $uctype,
342
+ 'permalink' => get_permalink($postID),
343
+ 'editPostLink' => get_edit_post_link($postID),
344
+ 'postDate' => $postDat[$idString]['postDate'],
345
+ 'isMultisite' => $postDat[$idString]['isMultisite'],
346
+ 'domain' => $postDat[$idString]['domain'],
347
+ 'path' => $postDat[$idString]['path'],
348
+ 'blog_id' => $blogID
349
  ))){
350
  $haveIssues = true;
351
  }
352
+ if(is_multisite()){
353
+ restore_current_blog();
354
+ }
355
  }
356
  }
357
  wordfence::statusEnd($statusIDX, $haveIssues);
396
  $statusIDX = wordfence::statusStart('Scanning comments for URL\'s in Google\'s Safe Browsing List');
397
  global $wpdb;
398
  $wfdb = new wfDB();
 
 
 
 
 
 
 
 
 
 
 
399
  $commentDat = array();
400
+ $h = new wordfenceURLHoover($this->apiKey, $this->wp_version);
401
+ $blogsToScan = $this->getBlogsToScan('comments');
402
+ foreach($blogsToScan as $blog){
403
+ $q1 = $wfdb->query("select comment_ID from " . $blog['table'] . " where comment_approved=1");
404
+ if( ! $q1){
405
+ wordfence::statusEndErr();
406
+ return;
407
+ }
408
+ if(! (mysql_num_rows($q1) > 0)){
409
+ continue;
410
+ }
411
+
412
+ while($idRow = mysql_fetch_assoc($q1)){
413
+ $row = $wfdb->querySingleRec("select comment_ID, comment_date, comment_type, comment_author, comment_author_url, comment_content from " . $blog['table'] . " where comment_ID=%d", $idRow['comment_ID']);
414
+ $h->hoover($blog['blog_id'] . '-' . $row['comment_ID'], $row['comment_author_url'] . ' ' . $row['comment_author'] . ' ' . $row['comment_content']);
415
+ $commentDat[$blog['blog_id'] . '-' . $row['comment_ID']] = array(
416
+ 'contentMD5' => md5($row['comment_content'] . $row['comment_author'] . $row['comment_author_url']),
417
+ 'author' => $row['comment_author'],
418
+ 'type' => ($row['comment_type'] ? $row['comment_type'] : 'comment'),
419
+ 'date' => $row['comment_date'],
420
+ 'isMultisite' => $blog['isMultisite'],
421
+ 'domain' => $blog['domain'],
422
+ 'path' => $blog['path'],
423
+ 'blog_id' => $blog['blog_id']
424
+ );
425
+ }
426
  }
427
  $hooverResults = $h->getBaddies();
428
  if($h->errorMsg){
431
  return;
432
  }
433
  $haveIssues = false;
434
+ foreach($hooverResults as $idString => $hresults){
435
+ $arr = explode('-', $idString);
436
+ $blogID = $arr[0];
437
+ $commentID = $arr[1];
438
+ $uctype = ucfirst($commentDat[$idString]['type']);
439
+ $type = $commentDat[$idString]['type'];
440
  foreach($hresults as $result){
441
  if($result['badList'] == 'goog-malware-shavar'){
442
  $shortMsg = "$uctype contains a suspected malware URL.";
448
  //A list type that may be new and the plugin has not been upgraded yet.
449
  continue;
450
  }
451
+ if(is_multisite()){
452
+ switch_to_blog($blogID);
453
+ }
454
+ $ignoreP = $idString;
455
+ $ignoreC = $idString . '-' . $commentDat[$idString]['contentMD5'];
456
+ if($this->addIssue('commentBadURL', 1, $ignoreP, $ignoreC, $shortMsg, $longMsg, array(
457
+ 'commentID' => $commentID,
458
  'badURL' => $result['URL'],
459
+ 'author' => $commentDat[$idString]['author'],
460
  'type' => $type,
461
  'uctype' => $uctype,
462
+ 'editCommentLink' => get_edit_comment_link($commentID),
463
+ 'commentDate' => $commentDat[$idString]['date'],
464
+ 'isMultisite' => $commentDat[$idString]['isMultisite'],
465
+ 'domain' => $commentDat[$idString]['domain'],
466
+ 'path' => $commentDat[$idString]['path'],
467
+ 'blog_id' => $blogID
468
  ))){
469
  $haveIssues = true;
470
  }
471
+ if(is_multisite()){
472
+ restore_current_blog();
473
+ }
474
  }
475
  }
476
  wordfence::statusEnd($statusIDX, $haveIssues);
477
  }
478
+ public function getBlogsToScan($table){
479
+ $wfdb = new wfDB();
480
+ global $wpdb;
481
+ $prefix = $wpdb->base_prefix;
482
+ $blogsToScan = array();
483
+ if(is_multisite()){
484
+ $q1 = $wfdb->query("select blog_id, domain, path from $prefix"."blogs where deleted=0 order by blog_id asc");
485
+ while($row = mysql_fetch_assoc($q1)){
486
+ $row['isMultisite'] = true;
487
+ if($row['blog_id'] == 1){
488
+ $row['table'] = $prefix . $table;
489
+ } else {
490
+ $row['table'] = $prefix . $row['blog_id'] . '_' . $table;
491
+ }
492
+ array_push($blogsToScan, $row);
493
+ }
494
+ } else {
495
+ array_push($blogsToScan, array(
496
+ 'isMultisite' => false,
497
+ 'table' => $prefix . $table,
498
+ 'blog_id' => '1',
499
+ 'domain' => '',
500
+ 'path' => '',
501
+ ));
502
+ }
503
+ return $blogsToScan;
504
+ }
505
  private function highestCap($caps){
506
  foreach(array('administrator', 'editor', 'author', 'contributor', 'subscriber') as $cap){
507
  if(empty($caps[$cap]) === false && $caps[$cap]){
625
  $currentCNAME = implode(', ', $cnameArr);
626
  $loggedCNAME = wfConfig::get('wf_dnsCNAME');
627
  $dnsLogged = wfConfig::get('wf_dnsLogged', false);
628
+ $msg = "A change in your DNS records may indicate that a hacker has hacked into your DNS administration system and has pointed your email or website to their own server for malicious purposes. It could also indicate that your domain has expired. If you made this change yourself you can mark it 'resolved' and safely ignore it.";
629
  if($dnsLogged && $loggedCNAME != $currentCNAME){
630
  if($this->addIssue('dnsChange', 2, 'dnsChanges', 'dnsChanges', "Your DNS records have changed", "We have detected a change in the CNAME records of your DNS configuration for the domain $host. A CNAME record is an alias that is used to point a domain name to another domain name. For example foo.example.com can point to bar.example.com which then points to an IP address of 10.1.1.1. $msg", array(
631
  'type' => 'CNAME',
652
  $currentA = implode(', ', $aArr);
653
  $loggedA = wfConfig::get('wf_dnsA');
654
  $dnsLogged = wfConfig::get('wf_dnsLogged', false);
 
655
  if($dnsLogged && $loggedA != $currentA){
656
  if($this->addIssue('dnsChange', 2, 'dnsChanges', 'dnsChanges', "Your DNS records have changed", "We have detected a change in the A records of your DNS configuration that may affect the domain $host. An A record is a record in DNS that points a domain name to an IP address. $msg", array(
657
  'type' => 'A',
lib/wfViewResult.php CHANGED
@@ -2,7 +2,7 @@
2
  <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
- <link rel='stylesheet' id='wordfence-main-style-css' href='<?php echo wfUtils::getBaseURL(); ?>/css/diff.css?ver=<?php echo WORDFENCE_VERSION ?>' type='text/css' media='all' />
6
  <body>
7
  <h1>Wordfence: File Viewer</h1>
8
  <table border="0" style="margin: 0 0 20px 0;" class="summary">
@@ -15,8 +15,7 @@
15
  if($isEmpty){
16
  echo "File is empty.";
17
  } else {
18
- wfUtils::requestMaxMemory();
19
- echo $geshi->parse_code();
20
  }
21
  ?>
22
 
2
  <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
+ <link rel='stylesheet' id='wordfence-main-style-css' href='<?php echo wfUtils::getBaseURL(); ?>/css/diff.css?ver=<?php echo wfUtils::myVersion(); ?>' type='text/css' media='all' />
6
  <body>
7
  <h1>Wordfence: File Viewer</h1>
8
  <table border="0" style="margin: 0 0 20px 0;" class="summary">
15
  if($isEmpty){
16
  echo "File is empty.";
17
  } else {
18
+ highlight_string($cont);
 
19
  }
20
  ?>
21
 
lib/wordfenceClass.php CHANGED
@@ -4,7 +4,6 @@ require_once('wfScanEngine.php');
4
  require_once('wfCrawl.php');
5
  require_once 'Diff.php';
6
  require_once 'Diff/Renderer/Html/SideBySide.php';
7
- require_once 'geshi.php';
8
  require_once 'wfAPI.php';
9
  require_once 'wfIssues.php';
10
  require_once('wfDB.php');
@@ -51,6 +50,11 @@ class wordfence {
51
 
52
  //Upgrading from 1.5.6 or earlier needs:
53
  $db->createKeyIfNotExists($prefix . 'wfStatus', 'level', 'k2');
 
 
 
 
 
54
  }
55
  public static function uninstallPlugin(){
56
  update_option('wordfenceActivated', 0);
@@ -165,6 +169,13 @@ class wordfence {
165
  global $blog_id;
166
  if($blog_id == 1 && get_option('wordfenceActivated') != 1){ return; } //Because the plugin is active once installed, even before it's network activated, for site 1 (WordPress team, why?!)
167
  }
 
 
 
 
 
 
 
168
  add_action('wordfence_daily_cron', 'wordfence::dailyCron');
169
  add_action('wordfence_hourly_cron', 'wordfence::hourlyCron');
170
  add_action('plugins_loaded', 'wordfence::veryFirstAction');
@@ -530,13 +541,17 @@ class wordfence {
530
  $opts['liveTraf_ignoreIPs'] = implode(',', $validIPs);
531
  }
532
  $reload = '';
 
533
  if($opts['apiKey'] != wfConfig::get('apiKey')){
534
  $api = new wfAPI($opts['apiKey'], wfUtils::getWPVersion());
535
  $res = $api->call('check_api_key', array(), array());
536
- if($res['ok'] && $res['isPaid']){
537
  wfConfig::set('apiKey', $opts['apiKey']);
538
  $reload = 'reload';
539
  wfConfig::set('isPaid', $res['isPaid']);
 
 
 
540
  } else if($res['errorMsg']){
541
  return array('errorMsg' => $res['errorMsg']);
542
  } else {
@@ -564,7 +579,7 @@ class wordfence {
564
  if($err){
565
  return array('errorMsg' => $err);
566
  } else {
567
- return array('ok' => 1, 'reload' => $reload );
568
  }
569
  }
570
  public static function ajax_clearAllBlocked_callback(){
@@ -782,7 +797,7 @@ class wordfence {
782
  wfConfig::set('apiKey', '');
783
  return array("errorMsg" => $api->errorMsg );
784
  }
785
- if($result['ok'] && $result['isPaid']){
786
  wfConfig::set('isPaid', $result['isPaid']);
787
  $err = self::startScan();
788
  if($err){
@@ -795,6 +810,7 @@ class wordfence {
795
  }
796
  }
797
  public static function ajax_scan_callback(){
 
798
  $err = self::startScan();
799
  if($err){
800
  return array('errorMsg' => $err);
@@ -803,9 +819,13 @@ class wordfence {
803
  }
804
  }
805
  public static function startScan(){
 
806
  $cron_url = plugins_url('wordfence/wfscan.php');
 
807
  $cronKey = wfUtils::bigRandomHex();
 
808
  wfConfig::set('currentCronKey', time() . ',' . $cronKey);
 
809
  $result = wp_remote_post( $cron_url, array(
810
  'timeout' => 0.5,
811
  'blocking' => true,
@@ -814,42 +834,27 @@ class wordfence {
814
  'x-wordfence-cronkey' => $cronKey
815
  )
816
  ) );
817
- /* This is a timeout in all likelihood, so ignore
818
- if(is_wp_error($result) && sizeof($result->errors) > 0){
819
- $errs = "";
820
- $isTimeout = false;
821
- foreach($result->errors as $key => $val){
822
- $errs .= $key . ": ";
823
- foreach($val as $e){
824
- $errs .= $e . ' ';
825
- if(preg_match('/timed/i', $e)){
826
- $isTimeout = true;
827
- }
828
- }
829
- }
830
- if(! $isTimeout){
831
- return "Error connecting to Wordfence scanning system: " . $errs;
832
- }
833
- }
834
- */
835
- if((! is_wp_error($result)) && is_array($result) && empty($result['body']) === false && strstr($result['body'], '{') !== false){
836
- $resp = json_decode($result['body'], true);
837
- if(empty($resp['errorMsg']) === false){
838
- return $resp['errorMsg'];
839
- }
840
- }
841
-
842
  //If the currentCronKey was eaten, then cron executed so return
843
- wfConfig::clearCache(); if(! wfConfig::get('currentCronKey')){ return false; }
 
 
 
844
 
845
  //This second request is for hosts that don't know their own name. i.e. they don't have example.com in their hosts file or DNS pointing to their own IP address or loopback address. So we throw a hail mary to loopback.
 
846
  usleep(200000);
847
  wfConfig::clearCache();
848
  if(wfConfig::get('currentCronKey')){ //cron key is still set, so cron hasn't executed yet. Maybe the request didn't go through
 
849
  $cron_url = preg_replace('/^(https?):\/\/[^\/]+/', '$1://127.0.0.1', $cron_url);
 
850
  $siteURL = site_url();
 
851
  if(preg_match('/^https?:\/\/([^\/]+)/i', site_url(), $matches)){
852
  $host = $matches[1];
 
853
  $result = wp_remote_post( $cron_url, array(
854
  'timeout' => 0.5,
855
  'blocking' => true,
@@ -859,31 +864,36 @@ class wordfence {
859
  'Host' => $host
860
  )
861
  ) );
862
- /* Is probably a timeout
863
- if(is_wp_error($result) && sizeof($result->errors) > 0){
864
- $errs = "";
865
- $isTimeout = false;
866
- foreach($result->errors as $key => $val){
867
- $errs .= $key . ": ";
868
- foreach($val as $e){
869
- $errs .= $e . ' ';
870
- if(preg_match('/timed/i', $e)){
871
- $isTimeout = true;
872
- }
873
- }
874
- }
875
- if(! $isTimeout){
876
- return "Error connecting to Wordfence scanning system: " . $errs;
877
- }
878
  }
879
- */
880
- if((! is_wp_error($result)) && is_array($result) && empty($result['body']) === false && strstr($result['body'], '{') !== false){
881
- $resp = json_decode($result['body'], true);
882
- if(empty($resp['errorMsg']) === false){
883
- return $resp['errorMsg'];
884
- }
 
 
 
 
 
 
 
 
885
  }
886
-
887
  }
888
  }
889
  return false;
@@ -903,7 +913,7 @@ class wordfence {
903
  }
904
  }
905
 
906
- if(! ($wfFunc == 'diff' || $wfFunc == 'view' || $wfFunc == 'sysinfo' || $wfFunc == 'IPTraf')){
907
  return;
908
  }
909
  if(! self::isAdmin()){
@@ -923,6 +933,8 @@ class wordfence {
923
  require('sysinfo.php');
924
  } else if($wfFunc == 'IPTraf'){
925
  self::wfFunc_IPTraf();
 
 
926
  }
927
  exit(0);
928
  }
@@ -931,6 +943,10 @@ class wordfence {
931
  }
932
  public static function shutdownAction(){
933
  }
 
 
 
 
934
  public static function wfFunc_IPTraf(){
935
  $IP = $_GET['IP'];
936
  $reverseLookup = self::getLog()->reverseLookup($IP);
@@ -981,41 +997,6 @@ class wordfence {
981
  $fileSize = @filesize($localFile);
982
  $fileSize = number_format($fileSize, 0, '', ',') . ' bytes';
983
 
984
- if(preg_match('/\.php$/i', $localFile)){
985
- $lang = 'php';
986
- //echo highlight_string($cont, true);
987
- //exit(0);
988
- } else if(preg_match('/\.js$/i', $localFile)){
989
- $lang = 'javascript';
990
- } else if(preg_match('/\.css$/i', $localFile)){
991
- $lang = 'css';
992
- } else if(preg_match('/\.(?:html|htm)$/i', $localFile)){
993
- $lang = 'html4strict';
994
- } else if(preg_match('/\.txt$/i', $localFile)){
995
- $lang = 'text';
996
- } else if(preg_match('/^\.htaccess$/i', $localFile)){
997
- $lang = 'apache';
998
- } else if(preg_match('/\.sh$/i', $localFile)){
999
- $lang = 'bash';
1000
- } else if(preg_match('/\.java$/i', $localFile)){
1001
- $lang = 'java';
1002
- } else if(preg_match('/\.pl$/i', $localFile)){
1003
- $lang = 'perl';
1004
- } else if(preg_match('/\.py$/i', $localFile)){
1005
- $lang = 'python';
1006
- } else if(preg_match('/\.rb$/i', $localFile)){
1007
- $lang = 'ruby';
1008
- } else {
1009
- header('Content-Type: text/plain');
1010
- echo $cont;
1011
- exit(0);
1012
- }
1013
- $geshi = new GeSHi($cont, $lang);
1014
- $geshi->set_header_type(GESHI_HEADER_DIV);
1015
- $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
1016
- $geshi->enable_keyword_links(false);
1017
-
1018
- //echo $geshi->parse_code();
1019
  require 'wfViewResult.php';
1020
  exit(0);
1021
  }
@@ -1080,13 +1061,19 @@ class wordfence {
1080
  wp_localize_script('wordfenceAdminjs', 'WordfenceAdminVars', array(
1081
  'ajaxURL' => admin_url('admin-ajax.php'),
1082
  'firstNonce' => wp_create_nonce('wp-ajax'),
1083
- 'siteBaseURL' => wfUtils::getSiteBaseURL()
 
1084
  ));
1085
 
1086
  }
1087
  public static function configure_warning(){
1088
  if(! preg_match('/WordfenceSecOpt/', $_SERVER['REQUEST_URI'])){
1089
- echo '<div id="wordfenceConfigWarning" class="updated fade"><p><strong>Please set up an email address to receive Wordfence security alerts. </strong> You can do this on the <a href="admin.php?page=WordfenceSecOpt">Wordfence Options Page</a>.</p></div>';
 
 
 
 
 
1090
  }
1091
  }
1092
  public static function admin_menus(){
@@ -1242,15 +1229,14 @@ class wordfence {
1242
  }
1243
  }
1244
  public static function statusDisabled($msg){
1245
- if(wfConfig::get('isPaid') == 'free'){
1246
- self::status(10, 'info', "SUM_PAIDONLY:" . $msg);
1247
- } else {
1248
- self::status(10, 'info', "SUM_DISABLED:" . $msg);
1249
- }
1250
  }
1251
  public static function wfSchemaExists(){
1252
  $db = new wfDB();
1253
- global $wpdb; $prefix = $wpdb->prefix;
1254
  $exists = $db->querySingle("show tables like '$prefix"."wfConfig'");
1255
  return $exists ? true : false;
1256
  }
4
  require_once('wfCrawl.php');
5
  require_once 'Diff.php';
6
  require_once 'Diff/Renderer/Html/SideBySide.php';
 
7
  require_once 'wfAPI.php';
8
  require_once 'wfIssues.php';
9
  require_once('wfDB.php');
50
 
51
  //Upgrading from 1.5.6 or earlier needs:
52
  $db->createKeyIfNotExists($prefix . 'wfStatus', 'level', 'k2');
53
+
54
+ if(wfConfig::get('isPaid') == 'free'){
55
+ wfConfig::set('isPaid', '');
56
+ }
57
+ wfConfig::set('alertEmailMsgCount', 0);
58
  }
59
  public static function uninstallPlugin(){
60
  update_option('wordfenceActivated', 0);
169
  global $blog_id;
170
  if($blog_id == 1 && get_option('wordfenceActivated') != 1){ return; } //Because the plugin is active once installed, even before it's network activated, for site 1 (WordPress team, why?!)
171
  }
172
+
173
+ //Upgrading from 2.0.3 we changed isPaid from 'free' or 'paid' to true and false
174
+ if(wfConfig::get('isPaid') == 'free'){
175
+ wfConfig::set('isPaid', '');
176
+ }
177
+ //end
178
+
179
  add_action('wordfence_daily_cron', 'wordfence::dailyCron');
180
  add_action('wordfence_hourly_cron', 'wordfence::hourlyCron');
181
  add_action('plugins_loaded', 'wordfence::veryFirstAction');
541
  $opts['liveTraf_ignoreIPs'] = implode(',', $validIPs);
542
  }
543
  $reload = '';
544
+ $paidKeyMsg = false;
545
  if($opts['apiKey'] != wfConfig::get('apiKey')){
546
  $api = new wfAPI($opts['apiKey'], wfUtils::getWPVersion());
547
  $res = $api->call('check_api_key', array(), array());
548
+ if($res['ok'] && isset($res['isPaid'])){
549
  wfConfig::set('apiKey', $opts['apiKey']);
550
  $reload = 'reload';
551
  wfConfig::set('isPaid', $res['isPaid']);
552
+ if($res['isPaid']){
553
+ $paidKeyMsg = true;
554
+ }
555
  } else if($res['errorMsg']){
556
  return array('errorMsg' => $res['errorMsg']);
557
  } else {
579
  if($err){
580
  return array('errorMsg' => $err);
581
  } else {
582
+ return array('ok' => 1, 'reload' => $reload, 'paidKeyMsg' => $paidKeyMsg );
583
  }
584
  }
585
  public static function ajax_clearAllBlocked_callback(){
797
  wfConfig::set('apiKey', '');
798
  return array("errorMsg" => $api->errorMsg );
799
  }
800
+ if($result['ok'] && isset($result['isPaid'])){
801
  wfConfig::set('isPaid', $result['isPaid']);
802
  $err = self::startScan();
803
  if($err){
810
  }
811
  }
812
  public static function ajax_scan_callback(){
813
+ self::status(4, 'info', "Ajax request received to start scan.");
814
  $err = self::startScan();
815
  if($err){
816
  return array('errorMsg' => $err);
819
  }
820
  }
821
  public static function startScan(){
822
+ self::status(4, 'info', "Entering start scan routine");
823
  $cron_url = plugins_url('wordfence/wfscan.php');
824
+ self::status(4, 'info', "Cron URL is: " . $cron_url);
825
  $cronKey = wfUtils::bigRandomHex();
826
+ self::status(4, 'info', "cronKey is: " . $cronKey);
827
  wfConfig::set('currentCronKey', time() . ',' . $cronKey);
828
+ self::status(4, 'info', "cronKey is set");
829
  $result = wp_remote_post( $cron_url, array(
830
  'timeout' => 0.5,
831
  'blocking' => true,
834
  'x-wordfence-cronkey' => $cronKey
835
  )
836
  ) );
837
+ $procResp = self::processResponse($result);
838
+ if($procResp){ return $procResp; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
839
  //If the currentCronKey was eaten, then cron executed so return
840
+ wfConfig::clearCache(); if(! wfConfig::get('currentCronKey')){
841
+ self::status(4, 'info', "cronkey is empty so cron executed. Returning.");
842
+ return false;
843
+ }
844
 
845
  //This second request is for hosts that don't know their own name. i.e. they don't have example.com in their hosts file or DNS pointing to their own IP address or loopback address. So we throw a hail mary to loopback.
846
+ self::status(4, 'info', "cronkey is still set so sleeping for 0.2 seconds and checking again before trying another approach");
847
  usleep(200000);
848
  wfConfig::clearCache();
849
  if(wfConfig::get('currentCronKey')){ //cron key is still set, so cron hasn't executed yet. Maybe the request didn't go through
850
+ self::status(4, 'info', "cronkey is still set so about to manually set host header and try again");
851
  $cron_url = preg_replace('/^(https?):\/\/[^\/]+/', '$1://127.0.0.1', $cron_url);
852
+ self::status(4, 'info', "cron url is: $cron_url");
853
  $siteURL = site_url();
854
+ self::status(4, 'info', "siteURL is: $siteURL");
855
  if(preg_match('/^https?:\/\/([^\/]+)/i', site_url(), $matches)){
856
  $host = $matches[1];
857
+ self::status(4, 'info', "Extracted host $host from siteURL and trying remote post with manual host header set.");
858
  $result = wp_remote_post( $cron_url, array(
859
  'timeout' => 0.5,
860
  'blocking' => true,
864
  'Host' => $host
865
  )
866
  ) );
867
+ $procResp = self::processResponse($result);
868
+ if($procResp){ return $procResp; }
869
+ }
870
+ }
871
+ return false;
872
+ }
873
+ public function processResponse($result){
874
+ if((! is_wp_error($result)) && is_array($result) && empty($result['body']) === false){
875
+ if(strpos($result['body'], 'WFSOURCEVISIBLE') !== false){
876
+ self::status(4, 'info', "wfscan.php source is visible.");
877
+ $msg = "Wordfence can't run because the source code of your WordPress plugin files is visible from the Internet. This is a serious security risk which you need to fix. Please look for .htaccess files in your WordPress root directory and your wp-content/ and wp-content/plugins/ directories that may contain malicious code designed to reveal your site source code to a hacker.";
878
+ $htfiles = array();
879
+ if(file_exists(ABSPATH . 'wp-content/.htaccess')){
880
+ array_push($htfiles, '<a href="' . wfUtils::getSiteBaseURL() . '?_wfsf=view&nonce=' . wp_create_nonce('wp-ajax') . '&file=wp-content/.htaccess" target="_blank">wp-content/.htaccess</a>');
 
 
881
  }
882
+ if(file_exists(ABSPATH . 'wp-content/plugins/.htaccess')){
883
+ array_push($htfiles, '<a href="' . wfUtils::getSiteBaseURL() . '?_wfsf=view&nonce=' . wp_create_nonce('wp-ajax') . '&file=wp-content/plugins/.htaccess" target="_blank">wp-content/plugins/.htaccess</a>');
884
+ }
885
+ if(sizeof($htfiles) > 0){
886
+ $msg .= "<br /><br />Click to view the .htaccess files below that may be the cause of this problem:<br />" . implode('<br />', $htfiles);
887
+ }
888
+ return $msg;
889
+
890
+ } else if(strpos($result['body'], '{') !== false && strpos($result['body'], 'errorMsg') !== false){
891
+ self::status(4, 'info', "Got response from cron containing json");
892
+ $resp = json_decode($result['body'], true);
893
+ if(empty($resp['errorMsg']) === false){
894
+ self::status(4, 'info', "Got an error message from cron: " . $resp['errorMsg']);
895
+ return $resp['errorMsg'];
896
  }
 
897
  }
898
  }
899
  return false;
913
  }
914
  }
915
 
916
+ if(! ($wfFunc == 'diff' || $wfFunc == 'view' || $wfFunc == 'sysinfo' || $wfFunc == 'IPTraf' || $wfFunc == 'viewActivityLog')){
917
  return;
918
  }
919
  if(! self::isAdmin()){
933
  require('sysinfo.php');
934
  } else if($wfFunc == 'IPTraf'){
935
  self::wfFunc_IPTraf();
936
+ } else if($wfFunc == 'viewActivityLog'){
937
+ self::wfFunc_viewActivityLog();
938
  }
939
  exit(0);
940
  }
943
  }
944
  public static function shutdownAction(){
945
  }
946
+ public static function wfFunc_viewActivityLog(){
947
+ require('viewFullActivityLog.php');
948
+ exit(0);
949
+ }
950
  public static function wfFunc_IPTraf(){
951
  $IP = $_GET['IP'];
952
  $reverseLookup = self::getLog()->reverseLookup($IP);
997
  $fileSize = @filesize($localFile);
998
  $fileSize = number_format($fileSize, 0, '', ',') . ' bytes';
999
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1000
  require 'wfViewResult.php';
1001
  exit(0);
1002
  }
1061
  wp_localize_script('wordfenceAdminjs', 'WordfenceAdminVars', array(
1062
  'ajaxURL' => admin_url('admin-ajax.php'),
1063
  'firstNonce' => wp_create_nonce('wp-ajax'),
1064
+ 'siteBaseURL' => wfUtils::getSiteBaseURL(),
1065
+ 'debugOn' => wfConfig::get('debugOn', 0)
1066
  ));
1067
 
1068
  }
1069
  public static function configure_warning(){
1070
  if(! preg_match('/WordfenceSecOpt/', $_SERVER['REQUEST_URI'])){
1071
+ $numRun = wfConfig::get('alertEmailMsgCount', 0);
1072
+ if($numRun <= 3){
1073
+ echo '<div id="wordfenceConfigWarning" class="updated fade"><p><strong>Please set up an email address to receive Wordfence security alerts</strong> on the <a href="admin.php?page=WordfenceSecOpt">Wordfence Options Page</a>. This message will appear ' . (3 - $numRun) . ' more times.</p></div>';
1074
+ wfConfig::set('alertEmailMsgCount', ++$numRun);
1075
+ }
1076
+
1077
  }
1078
  }
1079
  public static function admin_menus(){
1229
  }
1230
  }
1231
  public static function statusDisabled($msg){
1232
+ self::status(10, 'info', "SUM_DISABLED:" . $msg);
1233
+ }
1234
+ public static function statusPaidOnly($msg){
1235
+ self::status(10, 'info', "SUM_PAIDONLY:" . $msg);
 
1236
  }
1237
  public static function wfSchemaExists(){
1238
  $db = new wfDB();
1239
+ global $wpdb; $prefix = $wpdb->base_prefix;
1240
  $exists = $db->querySingle("show tables like '$prefix"."wfConfig'");
1241
  return $exists ? true : false;
1242
  }
lib/wordfenceConstants.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- define('WORDFENCE_VERSION', 1.4);
3
  define('WORDFENCE_API_URL', 'https://noc1.wordfence.com/');
4
  define('WORDFENCE_MAX_SCAN_TIME', 600);
5
  define('WORDFENCE_TRANSIENTS_TIMEOUT', 3600); //how long are items cached in seconds e.g. files downloaded for diffing
1
  <?php
2
+ define('WORDFENCE_VERSION', 1.5);
3
  define('WORDFENCE_API_URL', 'https://noc1.wordfence.com/');
4
  define('WORDFENCE_MAX_SCAN_TIME', 600);
5
  define('WORDFENCE_TRANSIENTS_TIMEOUT', 3600); //how long are items cached in seconds e.g. files downloaded for diffing
lib/wordfenceScanner.php CHANGED
@@ -107,9 +107,7 @@ class wordfenceScanner {
107
  break;
108
  }
109
 
110
- $decoded = array();
111
- preg_replace("/([a-zA-Z0-9\+\/\=]{10,})/e", "self::array_pushRet(\$decoded, base64_decode(\"$1\"))", $data);
112
- $urlHoover->hoover($file, $data . ' ' . implode(' ', $decoded));
113
  } else {
114
  $urlHoover->hoover($file, $data);
115
  }
@@ -170,7 +168,6 @@ class wordfenceScanner {
170
 
171
  return $this->results;
172
  }
173
- private function array_pushRet(&$arr, $elem){ array_push($arr, $elem); return $elem; }
174
  private function addEncIssue($ignoreP, $ignoreC, $encoding, $file){
175
  $this->addResult(array(
176
  'type' => 'file',
107
  break;
108
  }
109
 
110
+ $urlHoover->hoover($file, $data);
 
 
111
  } else {
112
  $urlHoover->hoover($file, $data);
113
  }
168
 
169
  return $this->results;
170
  }
 
171
  private function addEncIssue($ignoreP, $ignoreC, $encoding, $file){
172
  $this->addResult(array(
173
  'type' => 'file',
lib/wordfenceURLHoover.php CHANGED
@@ -12,7 +12,7 @@ class wordfenceURLHoover {
12
  $this->api = new wfAPI($apiKey, $wordpressVersion);
13
  $this->db = new wfDB();
14
  global $wpdb;
15
- $this->table = $wpdb->prefix . 'wfHoover';
16
  $this->db->query("truncate table $this->table");
17
  }
18
  public function hoover($id, $data){
12
  $this->api = new wfAPI($apiKey, $wordpressVersion);
13
  $this->db = new wfDB();
14
  global $wpdb;
15
+ $this->table = $wpdb->base_prefix . 'wfHoover';
16
  $this->db->query("truncate table $this->table");
17
  }
18
  public function hoover($id, $data){
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mmaunder
3
  Tags: wordpress, security, wordpress security, security plugin, secure, anti-virus, malware, firewall, antivirus, virus, google safe browsing, phishing, scrapers, hacking, wordfence, securty, secrity, secure
4
  Requires at least: 3.3.1
5
  Tested up to: 3.3.2
6
- Stable tag: 2.0.3
7
 
8
  Wordfence Security is a free enterprise class security plugin that includes a firewall, virus scanning, real-time traffic with geolocation and more.
9
 
@@ -15,20 +15,20 @@ Wordfence is now Multi-Site compatible. Support for Multi-Site is currently in B
15
 
16
  [Remember to visit our support forums if you have questions or comments.](http://wordfence.com/forums/)
17
 
18
- Wordfence is 100% free. You need to sign up on Wordfence.com to get a free API key.
19
- We also offer a Premium API key that adds additional scanning capabilities. See below for details.
20
 
21
  Wordfence:
22
 
23
  * Scans core files against repository versions to check their integrity.
24
  * WordPress Multi-Site (or WordPress MU in the older parlance) compatible (beta).
25
- * Premium API key also scans themes and plugins against repository versions. This is currently the only difference between free and premium API keys.
26
- * See how files have changed. Optionally repair changed files.
 
27
  * Scans for signatures of over 44,000 known malware variants that are known security threats.
28
  * Continuously scans for malware and phishing URL's in all your comments, posts and files that are security threats.
29
  * Scans for heuristics of backdoors, trojans, suspicious code and other security issues.
30
  * Checks the strength of all user and admin passwords to enhance login security.
31
- * Monitor for unauthorized DNS changes.
32
  * Includes a firewall to block common security threats like fake Googlebots, malicious scans from hackers and botnets.
33
  * Rate limit or block security threats like aggressive crawlers, scrapers and bots doing security scans for vulnerabilities in your site.
34
  * Choose whether you want to block or throttle users and robots who break your security rules.
@@ -37,6 +37,7 @@ Wordfence:
37
  * A real-time view of all traffic including automated bots that often constitute security threats that Javascript analytics packages never show you.
38
  * Real-time traffic includes reverse DNS and city-level geolocation. Know which geographic area security threats originate from.
39
  * Monitors disk space which is related to security because many DDoS attacks attempt to consume all disk space to create denial of service.
 
40
 
41
  Wordfence Security is full-featured and constantly updated by our team to incorporate the latest security features and to hunt for the
42
  newest security threats to your WordPress website.
@@ -49,44 +50,43 @@ To install Wordfence Security and start protecting your WordPress website:
49
 
50
  1. Install Wordfence Security automatically or by uploading the ZIP file.
51
  1. Activate the security plugin through the 'Plugins' menu in WordPress.
52
- 1. Visit [Wordfence.com to get an API key](http://wordfence.com/) which you need to security scans.
53
- 1. Go to the Wordfence menu option that appears on the left or your site's admin section.
54
- 1. Enter your API key and click the button.
55
- 1. Wordfence is now activated. Your first security scan will start automatically and scheduled security scanning will also be enabled.
56
  1. Visit the Wordfence options page to enter your email address so that you can receive email security alerts.
57
  1. Optionally change your security level or click the advanced options link to see individual security scanning and protection options.
58
- 1. Click the "Live Traffic" menu option to watch your site activity in real-time.
59
 
60
  To install Wordfence on WordPress Multi-Site installations (support is currently in Beta):
61
 
62
- 1. Install Wordfence via the plugin directory or by uploading the ZIP file.
63
- 1. Network Activate Wordfence. This step is important because until you network activate it, your sites will see the plugin option on their plugins menu. Once activated that option dissapears. If one of your users manages to sneak in and try to activate Wordfence between you installing Wordfence and network activating it, don't worry because they won't be allowed to activate the plugin. It will generate a warning and won't activate for an individual site.
64
  1. Now that Wordfence is network activated it will appear on your Network Admin menu. Wordfence will not appear on any individual site's menu.
65
- 1. Enter your API key to start your first scan.
66
- 1. Wordfence will scan all files in your WordPress installation including those in the blogs.dir directory of your individual sites.
67
- 1. Live Traffic will appear for ALL sites in your network. If you have a heavily trafficed system you may want to disable live traffic which will stop logging to the DB.
68
  1. Firewall rules and login rules apply to the WHOLE system. So if you fail a login on site1.example.com and site2.example.com it counts as 2 failures. Crawler traffic is counted between blogs, so if you hit three sites in the network, all the hits are totalled and that counts as the rate you're accessing the system.
69
- 1. Wordfence has been tested with subdomains, not with subdirectories yet, but it should work. Please report all bugs and we'll fix them as fast as we can.
70
 
71
  == Frequently Asked Questions ==
72
 
73
  [Remember to visit our support forums if you have questions or comments.](http://wordfence.com/forums/)
74
 
75
- = Why does Wordfence Security need an API key? =
76
 
77
- Wordfence securely contacts our servers when doing a security scan. These include: comparing the hashes of your core, theme and plugin files
78
- against the official versions to see if security has been compromised, checking if URL's in your comments, posts and files are on any known list of dangerous URL's and checking
79
- if any of your file signatures match a large list of known malware files that constitute a security threat.
 
 
80
 
81
  = Does Wordfence support Multi-Site installations? =
82
 
83
- Yes. WordPress MU or Multi-Site as it's called now is supported and support is currently in beta. See the installation tab for more info.
84
 
85
  = Will Wordfence slow my site down? =
86
 
87
  We have spent a lot of time making sure Wordfence runs very quickly and securely. Wordfence uses its own database
88
  tables and advanced mysql features to ensure it runs as fast as possible. The creators of Wordfence
89
- also run a large scale real-time analytics product and much of the technology and knowledge from
90
  our real-time analytics products is built into Wordfence.
91
 
92
  = How often is Wordfence updated? =
@@ -152,6 +152,25 @@ or a theme, because often these have been updated to fix a security hole.
152
  5. If you're technically minded, this is the under-the-hood view of Wordfence options where you can fine-tune your security settings.
153
 
154
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  = 2.0.3 =
156
  * Removed unbuffered queries and switched to conventional queries that are memory efficient for better stability.
157
  * Made scanning large numbers of URL's contained in things like awstats log files extremely memory efficient and way faster.
3
  Tags: wordpress, security, wordpress security, security plugin, secure, anti-virus, malware, firewall, antivirus, virus, google safe browsing, phishing, scrapers, hacking, wordfence, securty, secrity, secure
4
  Requires at least: 3.3.1
5
  Tested up to: 3.3.2
6
+ Stable tag: 2.0.5
7
 
8
  Wordfence Security is a free enterprise class security plugin that includes a firewall, virus scanning, real-time traffic with geolocation and more.
9
 
15
 
16
  [Remember to visit our support forums if you have questions or comments.](http://wordfence.com/forums/)
17
 
18
+ Wordfence is 100% free. We also offer a Premium API key that adds additional scanning capabilities.
 
19
 
20
  Wordfence:
21
 
22
  * Scans core files against repository versions to check their integrity.
23
  * WordPress Multi-Site (or WordPress MU in the older parlance) compatible (beta).
24
+ * Wordfence Security for multi-site also scans all posts and comments across all blogs from one admin panel.
25
+ * Premium API key also scans themes and plugins against repository versions.
26
+ * See how files have changed. Optionally repair changed files that are security threats.
27
  * Scans for signatures of over 44,000 known malware variants that are known security threats.
28
  * Continuously scans for malware and phishing URL's in all your comments, posts and files that are security threats.
29
  * Scans for heuristics of backdoors, trojans, suspicious code and other security issues.
30
  * Checks the strength of all user and admin passwords to enhance login security.
31
+ * Monitor your DNS security for unauthorized DNS changes.
32
  * Includes a firewall to block common security threats like fake Googlebots, malicious scans from hackers and botnets.
33
  * Rate limit or block security threats like aggressive crawlers, scrapers and bots doing security scans for vulnerabilities in your site.
34
  * Choose whether you want to block or throttle users and robots who break your security rules.
37
  * A real-time view of all traffic including automated bots that often constitute security threats that Javascript analytics packages never show you.
38
  * Real-time traffic includes reverse DNS and city-level geolocation. Know which geographic area security threats originate from.
39
  * Monitors disk space which is related to security because many DDoS attacks attempt to consume all disk space to create denial of service.
40
+ * Our online forums are available 24/7 to answer your WordPress security questions.
41
 
42
  Wordfence Security is full-featured and constantly updated by our team to incorporate the latest security features and to hunt for the
43
  newest security threats to your WordPress website.
50
 
51
  1. Install Wordfence Security automatically or by uploading the ZIP file.
52
  1. Activate the security plugin through the 'Plugins' menu in WordPress.
53
+ 1. Wordfence is now activated. Go to the scan menu and start your first security scan. Scheduled security scanning will also be enabled.
54
+ 1. Once your first scan has completed a list of security threats will appear. Go through them one by one to secure your site.
 
 
55
  1. Visit the Wordfence options page to enter your email address so that you can receive email security alerts.
56
  1. Optionally change your security level or click the advanced options link to see individual security scanning and protection options.
57
+ 1. Click the "Live Traffic" menu option to watch your site activity in real-time. Situational awareness is an important part of website security.
58
 
59
  To install Wordfence on WordPress Multi-Site installations (support is currently in Beta):
60
 
61
+ 1. Install Wordfence Security via the plugin directory or by uploading the ZIP file.
62
+ 1. Network Activate Wordfence Security. This step is important because until you network activate it, your sites will see the plugin option on their plugins menu. Once activated that option dissapears.
63
  1. Now that Wordfence is network activated it will appear on your Network Admin menu. Wordfence will not appear on any individual site's menu.
64
+ 1. Go to the "Scan" menu and start your first security scan.
65
+ 1. Wordfence will do a security scan all files in your WordPress installation including those in the blogs.dir directory of your individual sites.
66
+ 1. Live Traffic will appear for ALL sites in your network. If you have a heavily trafficked system you may want to disable live traffic which will stop logging to the DB.
67
  1. Firewall rules and login rules apply to the WHOLE system. So if you fail a login on site1.example.com and site2.example.com it counts as 2 failures. Crawler traffic is counted between blogs, so if you hit three sites in the network, all the hits are totalled and that counts as the rate you're accessing the system.
 
68
 
69
  == Frequently Asked Questions ==
70
 
71
  [Remember to visit our support forums if you have questions or comments.](http://wordfence.com/forums/)
72
 
73
+ = What does Wordfence Security do that other WordPress security plugins don't do? =
74
 
75
+ * Wordfence security scans including checking all your files, comments and posts for URL's in Google's Safe Browsing list.
76
+ * All Wordfence security scans happen hourly instead of daily or even less frequently.
77
+ * Wordfence scans do not consume large amounts of your precious bandwidth because all scans happen on your web server which makes them very fast.
78
+ * Wordfence fully supports WordPress Multi-Site which means you can security scan every blog in your Multi-Site installation with one click.
79
+ * Wordfence checks the integrity of your WordPress core files, plugins and themes against the original files in the WordPress repository. We alert you to any changes which may be a security threat, let you see what has changed and you can even repair changed files.
80
 
81
  = Does Wordfence support Multi-Site installations? =
82
 
83
+ Yes. WordPress MU or Multi-Site as it's called now is fully supported. Using Wordfence you can security scan every blog in your network with one click. If one of your customers posts a page or post with a known malware URL that threatens your whole domain with being blacklisted by Google, we will tell you within a maximum of one hour which is how often scans occur.
84
 
85
  = Will Wordfence slow my site down? =
86
 
87
  We have spent a lot of time making sure Wordfence runs very quickly and securely. Wordfence uses its own database
88
  tables and advanced mysql features to ensure it runs as fast as possible. The creators of Wordfence
89
+ also run Feedjit, a large scale real-time analytics product and ad network and much of the technology and knowledge from
90
  our real-time analytics products is built into Wordfence.
91
 
92
  = How often is Wordfence updated? =
152
  5. If you're technically minded, this is the under-the-hood view of Wordfence options where you can fine-tune your security settings.
153
 
154
  == Changelog ==
155
+ = 2.0.5 =
156
+ * If your plugin PHP files are viewable by the world, we now give you a detailed warning on the seriousness of this security threat with ability to view the offending .htaccess files.
157
+ * Added a debug mode in options for very verbose logging and marking errors in red.
158
+ * Added more logging for the process that starts the security scan.
159
+ * Ability to securely view the entire activity log added.
160
+ * Using plugin version in all CSS URL's instead of API version.
161
+ * Activity log microtime is more accurate now.
162
+ * Fixed bug that would cause security scanning of PHP files with base64 content to stop.
163
+
164
+ = 2.0.4 =
165
+ * Now security scanning all comments, posts and pages on multi-site installation for malware and phishing URL's.
166
+ * Improved messages on multisite when a bad comment or post is found.
167
+ * Fixed bug that caused paid users to not be able to activate their premium key.
168
+ * Made upgrade process much friendlier.
169
+ * Got rid of GeSHi syntax highlighting because it segfaults and is resource intensive. Using built in PHP highlighting instead.
170
+ * Message asking you to configure an alert email address only appears for 3 pageviews after plugin activation so it's less irritating.
171
+ * Fixed bug for MU users that caused WF to tell you that your WF schema is missing and you need to reactivate.
172
+ * Fixed bug that caused malware URL scanner to not work for MU users.
173
+
174
  = 2.0.3 =
175
  * Removed unbuffered queries and switched to conventional queries that are memory efficient for better stability.
176
  * Made scanning large numbers of URL's contained in things like awstats log files extremely memory efficient and way faster.
wfscan.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  ignore_user_abort(true);
3
  $wordfence_wp_version = false;
4
  if ( !defined('ABSPATH') ) {
@@ -20,41 +21,54 @@ require_once('lib/wfScanEngine.php');
20
 
21
  class wfScan {
22
  public static function wfScanMain(){
 
 
 
 
 
23
  if(! wordfence::wfSchemaExists()){
24
  self::errorExit("Looks like the Wordfence database tables have been deleted. You can fix this by de-activating and re-activating the Wordfence plugin from your Plugins menu.");
25
  }
 
26
  if(! $_SERVER['HTTP_X_WORDFENCE_CRONKEY']){
27
  self::errorExit("The Wordfence scanner did not receive the x_wordfence_cronkey secure header.");
28
  }
 
29
  $currentCronKey = wfConfig::get('currentCronKey', false);
30
  if(! $currentCronKey){
31
  self::errorExit("Wordfence could not find a saved cron key to start the scan.");
32
  }
33
 
 
34
  $savedKey = explode(',',$currentCronKey);
35
  if(time() - $savedKey[0] > 60){
36
  self::errorExit("The key used to start a scan has expired.");
37
  } //keys only last 60 seconds and are used within milliseconds of creation
 
38
  if($savedKey[1] != $_SERVER['HTTP_X_WORDFENCE_CRONKEY']){
39
  self::errorExit("Wordfence could not start a scan because the cron key does not match the saved key.");
40
  }
 
41
  wfConfig::set('currentCronKey', '');
42
  ini_set('max_execution_time', 1800); //30 mins
 
43
  self::becomeAdmin();
44
 
 
45
  $scanRunning = wfConfig::get('wf_scanRunning');
46
  if($scanRunning && time() - $scanRunning < WORDFENCE_MAX_SCAN_TIME){
47
  self::errorExit("There is already a scan running.");
48
  }
49
  wordfence::status(10, 'info', "SUM_PREP:Preparing a new scan.");
 
50
  wfUtils::requestMaxMemory();
51
-
52
  set_error_handler('wfScan::error_handler', E_ALL);
53
  register_shutdown_function('wfScan::shutdown');
54
  ob_start('wfScan::obHandler');
55
  @error_reporting(E_ALL);
56
  @ini_set('display_errors','On');
57
-
58
  wfConfig::set('wf_scanRunning', time());
59
  $scan = new wfScanEngine();
60
  $scan->go();
1
  <?php
2
+ /* Don't remove this line. WFSOURCEVISIBLE */
3
  ignore_user_abort(true);
4
  $wordfence_wp_version = false;
5
  if ( !defined('ABSPATH') ) {
21
 
22
  class wfScan {
23
  public static function wfScanMain(){
24
+ $db = new wfDB();
25
+ if($db->errorMsg){
26
+ self::errorExit("Could not connect to database to start scan: " . $db->errorMsg);
27
+ }
28
+ wordfence::status(4, 'info', "Scan engine received request.");
29
  if(! wordfence::wfSchemaExists()){
30
  self::errorExit("Looks like the Wordfence database tables have been deleted. You can fix this by de-activating and re-activating the Wordfence plugin from your Plugins menu.");
31
  }
32
+ wordfence::status(4, 'info', "Checking cronkey header");
33
  if(! $_SERVER['HTTP_X_WORDFENCE_CRONKEY']){
34
  self::errorExit("The Wordfence scanner did not receive the x_wordfence_cronkey secure header.");
35
  }
36
+ wordfence::status(4, 'info', "Fetching stored cronkey for comparison.");
37
  $currentCronKey = wfConfig::get('currentCronKey', false);
38
  if(! $currentCronKey){
39
  self::errorExit("Wordfence could not find a saved cron key to start the scan.");
40
  }
41
 
42
+ wordfence::status(4, 'info', "Exploding stored cronkey");
43
  $savedKey = explode(',',$currentCronKey);
44
  if(time() - $savedKey[0] > 60){
45
  self::errorExit("The key used to start a scan has expired.");
46
  } //keys only last 60 seconds and are used within milliseconds of creation
47
+ wordfence::status(4, 'info', "Checking saved cronkey against cronkey header");
48
  if($savedKey[1] != $_SERVER['HTTP_X_WORDFENCE_CRONKEY']){
49
  self::errorExit("Wordfence could not start a scan because the cron key does not match the saved key.");
50
  }
51
+ wordfence::status(4, 'info', "Deleting stored cronkey");
52
  wfConfig::set('currentCronKey', '');
53
  ini_set('max_execution_time', 1800); //30 mins
54
+ wordfence::status(4, 'info', "Becoming admin for scan");
55
  self::becomeAdmin();
56
 
57
+ wordfence::status(4, 'info', "Checking if scan is already running");
58
  $scanRunning = wfConfig::get('wf_scanRunning');
59
  if($scanRunning && time() - $scanRunning < WORDFENCE_MAX_SCAN_TIME){
60
  self::errorExit("There is already a scan running.");
61
  }
62
  wordfence::status(10, 'info', "SUM_PREP:Preparing a new scan.");
63
+ wordfence::status(4, 'info', "Requesting max memory");
64
  wfUtils::requestMaxMemory();
65
+ wordfence::status(4, 'info', "Setting up error handling environment");
66
  set_error_handler('wfScan::error_handler', E_ALL);
67
  register_shutdown_function('wfScan::shutdown');
68
  ob_start('wfScan::obHandler');
69
  @error_reporting(E_ALL);
70
  @ini_set('display_errors','On');
71
+ wordfence::status(4, 'info', "Setting up scanRunning and starting scan");
72
  wfConfig::set('wf_scanRunning', time());
73
  $scan = new wfScanEngine();
74
  $scan->go();
wordfence.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Wordfence Security
4
  Plugin URI: http://wordfence.com/
5
  Description: Wordfence Security - Anti-virus and Firewall security plugin for WordPress
6
  Author: Mark Maunder
7
- Version: 2.0.3
8
  Author URI: http://wordfence.com/
9
  */
10
  require_once('lib/wordfenceConstants.php');
4
  Plugin URI: http://wordfence.com/
5
  Description: Wordfence Security - Anti-virus and Firewall security plugin for WordPress
6
  Author: Mark Maunder
7
+ Version: 2.0.5
8
  Author URI: http://wordfence.com/
9
  */
10
  require_once('lib/wordfenceConstants.php');