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

UserModel - Stikked
From PSANTOS, 11 Years ago, written in Ruby.
Embed
  1. class User < ActiveRecord::Base
  2.         EMAIL_REGEXP = /\A[^@]+@([^@\.]+\.)+[^@\.]+\z/
  3.  
  4.         has_many :rooms
  5.  
  6.         validates_presence_of :email, :full_name, :location
  7.         validates_length_of :bio, minimum: 30, allow_blank: false
  8.         validates_uniqueness_of :email
  9.  
  10.         validate do
  11.                 errors.add(:email, :invalid) unless email.match(EMAIL_REGEXP)
  12.         end
  13.  
  14.         has_secure_password
  15.  
  16.         before_create do |user|
  17.                 user.confirmation_token = SecureRandom.urlsafe_base64
  18.         end
  19.  
  20.         scope :confirmed, -> { where.not(confirmed_at: nil) }
  21.  
  22.         def self.authenticate(email, password)
  23.                 user = confirmed.
  24.                         find_by(email: email).
  25.                         try(:authenticate, password)
  26.         end
  27.  
  28.         def confirm!
  29.                 return if confirmed?
  30.  
  31.                 self.confirmed_at = Time.current
  32.                 self.confirmation_token = ''
  33.                 save!
  34.         end
  35.  
  36.         def confirmed?
  37.                 confirmed_at.present?
  38.         end
  39. end