5.2.8 버전변경

This commit is contained in:
thisgun
2017-06-14 10:18:28 +09:00
12 changed files with 145 additions and 15 deletions

View File

@ -628,7 +628,7 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op
// SQL Injection 방지
// 필드값에 a-z A-Z 0-9 _ , | 이외의 값이 있다면 검색필드를 wr_subject 로 설정한다.
$field[$k] = preg_match("/^[\w\,\|]+$/", $field[$k]) ? $field[$k] : "wr_subject";
$field[$k] = preg_match("/^[\w\,\|]+$/", $field[$k]) ? strtolower($field[$k]) : "wr_subject";
$str .= $op2;
switch ($field[$k]) {
@ -3212,7 +3212,7 @@ class str_encrypt
function __construct($salt='')
{
if(!$salt)
$this->salt = md5(G5_MYSQL_PASSWORD);
$this->salt = md5(preg_replace('/[^0-9A-Za-z]/', substr(G5_MYSQL_USER, -1), G5_MYSQL_PASSWORD));
else
$this->salt = $salt;
@ -3275,9 +3275,68 @@ function check_write_token($bo_table)
return true;
}
function get_call_func_cache($func, $args=array()){
static $cache = array();
$key = md5(serialize($args));
if( isset($cache[$func]) && isset($cache[$func][$key]) ){
return $cache[$func][$key];
}
$result = null;
try{
$cache[$func][$key] = $result = call_user_func_array($func, $args);
} catch (Exception $e) {
return null;
}
return $result;
}
// include 하는 경로에 data file 경로가 포함되어 있는지 체크합니다.
function is_include_path_check($path='')
{
if( $path ){
try {
// whether $path is unix or not
$unipath = strlen($path)==0 || $path{0}!='/';
$unc = substr($path,0,2)=='\\\\'?true:false;
// attempts to detect if path is relative in which case, add cwd
if(strpos($path,':') === false && $unipath && !$unc){
$path=getcwd().DIRECTORY_SEPARATOR.$path;
if($path{0}=='/'){
$unipath = false;
}
}
// resolve path parts (single dot, double dot and double delimiters)
$path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
$parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
$absolutes = array();
foreach ($parts as $part) {
if ('.' == $part){
continue;
}
if ('..' == $part) {
array_pop($absolutes);
} else {
$absolutes[] = $part;
}
}
$path = implode(DIRECTORY_SEPARATOR, $absolutes);
// resolve any symlinks
// put initial separator that could have been lost
$path = !$unipath ? '/'.$path : $path;
$path = $unc ? '\\\\'.$path : $path;
} catch (Exception $e) {
//echo 'Caught exception: ', $e->getMessage(), "\n";
return false;
}
}
if( !$path || preg_match('/\/data\/(file|editor)\/[A-Za-z0-9_]{1,20}\//', $path) ){
return false;
}