Update security.php
This commit is contained in:
parent
e0b561d647
commit
1dc251f5dd
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @file security.php
|
* @file security.php
|
||||||
* @date 2018-01-18
|
* @date 2018-05-27
|
||||||
* @author Go Namhyeon <gnh1201@gmail.com>
|
* @author Go Namhyeon <gnh1201@gmail.com>
|
||||||
* @brief Security module for VSPF
|
* @brief Security module for ReasonableFramework
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!function_exists("check_token_abuse")) {
|
if(!function_exists("check_token_abuse")) {
|
||||||
|
@ -516,7 +516,7 @@ if(!function_exists("xor_this")) {
|
||||||
$text = $string;
|
$text = $string;
|
||||||
$outText = "";
|
$outText = "";
|
||||||
|
|
||||||
for($i = 0; $i<strlen($text); ) {
|
for($i = 0; $i < strlen($text); ) {
|
||||||
for($j = 0; ($j < strlen($key) && $i < strlen($text)); $j++, $i++) {
|
for($j = 0; ($j < strlen($key) && $i < strlen($text)); $j++, $i++) {
|
||||||
$outText .= $text{$i} ^ $key{$j};
|
$outText .= $text{$i} ^ $key{$j};
|
||||||
|
|
||||||
|
@ -549,27 +549,5 @@ if(!function_exists("get_generated_name")) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!function_exists("get_formatted_number")) {
|
|
||||||
function get_formatted_number($value) {
|
|
||||||
return number_format(floatval($value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!function_exists("get_cutted_string")) {
|
|
||||||
function get_cutted_string($str, $start, $len=0, $charset="utf-8") {
|
|
||||||
$out_str = "";
|
|
||||||
|
|
||||||
if(function_exists("iconv_substr")) {
|
|
||||||
$out_str = iconv_substr($str, $start, $len, $charset);
|
|
||||||
} elseif(function_exists("mb_substr")) {
|
|
||||||
$out_str = mb_substr($str, $start, $len, $charset);
|
|
||||||
} else {
|
|
||||||
$out_str = substr($str, $start, $len);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $out_str;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// start session (enable $_SESSION)
|
// start session (enable $_SESSION)
|
||||||
session_start();
|
session_start();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user