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 Flying Matamata, 10 Years ago, written in PHP.
Embed
  1. <?php
  2.  
  3. if (validate(array('password', 'user'), '/login')) {
  4.  
  5.     global $link;
  6.  
  7.     $salt = get_salt();
  8.  
  9.     $hash = md5($_POST['password'] . $salt);
  10.     if (!empty($_POST['user']) && preg_match('/^[^@]+?@.+?\..+$/', $_POST['user'])) {
  11.         $mail_hash = md5($_POST['user'] . $salt);
  12.  
  13.         $result = mysql_query(
  14.           "SELECT * FROM users WHERE email = '{$_POST['user']}'",
  15.           $link
  16.         );
  17.  
  18.         if ($row = mysql_fetch_assoc($result)) {
  19.             $user_name = $row['name'];
  20.         }
  21.         else {
  22.             $errors[] = 1;
  23.         }
  24.     }
  25.     else {
  26.         $user_name = $_POST['user'];
  27.  
  28.         $result = mysql_query(
  29.           "SELECT * FROM users WHERE name = '{$_POST['user']}'",
  30.           $link
  31.         );
  32.  
  33.         if ($row = mysql_fetch_assoc($result)) {
  34.             $mail_hash = md5($row['email'] . $salt);
  35.         }
  36.         else {
  37.             $errors[] = 1;
  38.         }
  39.     }
  40.  
  41.     if (!empty($errors)) {
  42.         process_errors($errors, '/login');
  43.     }
  44.     else {
  45.         $result = mysql_query(
  46.           "SELECT * FROM users WHERE name = '$user_name' AND hash = '$mail_hash-$hash'",
  47.           $link
  48.         );
  49.  
  50.         if ($row = mysql_fetch_assoc($result)) {
  51.             setcookie("session_id", "$mail_hash-$hash", time() + 24 * 3600, '/');
  52.         }
  53.         else {
  54.             $errors[] = 1;
  55.             process_errors($errors, '/login');
  56.         }
  57.  
  58.         mysql_close($link);
  59.  
  60.         header('location: /');
  61.     }
  62. }
  63.