A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Untitled - Stikked
From Walloping Lechwe, 11 Years ago, written in Java.
Embed
  1. package de.YonasCode.AdminHelper.Database;
  2.  
  3. import java.io.BufferedReader;
  4. import java.io.File;
  5. import java.io.FileInputStream;
  6. import java.io.IOException;
  7. import java.io.InputStream;
  8. import java.io.InputStreamReader;
  9. import java.util.ArrayList;
  10. import java.util.regex.Matcher;
  11. import java.util.regex.Pattern;
  12.  
  13. import org.apache.commons.lang.StringUtils;
  14.  
  15. import de.YonasCode.AdminHelper.Main;
  16.  
  17. public class BadWordsDatabase {
  18.        
  19.         private File database = new File("plugins/" + Main.INSTANCE.getDescription().getName(), "badwords.txt");
  20.         private ArrayList<String> cache = new ArrayList<String>();
  21.         private InputStream is;
  22.         private InputStreamReader isr;
  23.         private BufferedReader br;
  24.        
  25.         public void loadDatabase() throws IOException {
  26.                 try {
  27.                         is = new FileInputStream(database);
  28.                         isr = new InputStreamReader(is);
  29.                         br = new BufferedReader(isr);
  30.                        
  31.                         if(!(database.exists())) {
  32.                                 database.createNewFile();
  33.                         }
  34.                
  35.                         String line;
  36.                
  37.                         while((line = br.readLine()) != null) {
  38.                                 cache.add(line.toLowerCase());
  39.                         }
  40.                
  41.                         Main.LOG.info("Cache-Size: " + cache.size());
  42.                 } finally {
  43.                         if(is != null) is.close();
  44.                         if(isr != null) isr.close();
  45.                         if(br != null) br.close();
  46.                 }
  47.         }
  48.        
  49.         public boolean check(String word) {
  50.                 boolean is = false;
  51.                 for(String s : cache) {
  52.                         if(s != null)
  53.                                 if(s.equalsIgnoreCase(word.toLowerCase()))
  54.                                         is = true;
  55.                 }
  56.                 return is;
  57.         }
  58.        
  59.         public boolean contains(String word) {
  60.                 String pattern = "(" + StringUtils.join(this.cache, "|") + ")";
  61.                 Pattern pat = Pattern.compile(pattern);
  62.                 Matcher mat = pat.matcher(word.toLowerCase());
  63.                 return mat.find();
  64.         }
  65.        
  66.         /*
  67.          * this class is in work
  68.          */
  69.        
  70. }