php8.0 버전 호환 코드 적용 및 PHP 끝 태그 삭제 일괄적용

This commit is contained in:
thisgun
2021-01-04 15:33:29 +09:00
parent 10d377de7d
commit 582d1a01f4
852 changed files with 120617 additions and 6307 deletions

View File

@ -1,6 +1,26 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if( ! function_exists('array_map_deep') ){
// multi-dimensional array에 사용자지정 함수적용
function array_map_deep($fn, $array)
{
if(is_array($array)) {
foreach($array as $key => $value) {
if(is_array($value)) {
$array[$key] = array_map_deep($fn, $value);
} else {
$array[$key] = call_user_func($fn, $value);
}
}
} else {
$array = call_user_func($fn, $array);
}
return $array;
}
}
if( ! function_exists('safe_install_string_check') ){
function safe_install_string_check( $str, $is_json=false ) {
$is_check = false;
@ -23,7 +43,7 @@ if( ! function_exists('safe_install_string_check') ){
die($msg);
}
return $str;
return array_map_deep('stripslashes', $str);
}
}
@ -36,5 +56,4 @@ if( ! function_exists('install_json_msg') ){
return json_encode(array('error'=>$error_msg, 'success'=>$success_msg, 'exists'=>$exists_msg));
}
}
?>
}